LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/controlbits.c
// Function: merge_64b
static void merge_64b(int n,uint64_t x[n],int step)
{
  int i;
  if (n == 1)
    minmax_64b(&x[0],&x[step]);
  else {
    merge_64b(n / 2,x,step * 2);
    merge_64b(n / 2,x + step,step * 2);
    for (i = 1;i < 2*n-1;i += 2)
      minmax_64b(&x[i * step],&x[(i + 1) * step]);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpl $0x1, -0x4(%rbp)
jne 0x91c5
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x9260
jmp 0x9259
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
shll %edx
callq 0x9190
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movl -0x14(%rbp), %edx
shll %edx
callq 0x9190
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x4(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x9257
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %eax
imull -0x14(%rbp), %eax
cltq
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x18(%rbp), %eax
addl $0x1, %eax
imull -0x14(%rbp), %eax
cltq
shlq $0x3, %rax
addq %rax, %rsi
callq 0x9260
movl -0x18(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x18(%rbp)
jmp 0x920d
jmp 0x9259
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/controlbits.c
// Function: is_smaller_64b
static bit is_smaller_64b(uint64_t a, uint64_t b)
{
  uint64_t ret = 0;

  a >>= 1; 
  b >>= 1;
  ret = a - b;
  ret >>= 63;

  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
shrq %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
shrq %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
subq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
shrq $0x3f, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/controlbits.c
// Function: cswap_64b
static void cswap_64b(uint64_t *x,uint64_t *y,bit swap)
{
  uint64_t m;
  uint64_t d;
  uint64_t z = 0;

  z -= swap ;
  m = z;

  d = (*x ^ *y);
  d &= m;
  *x ^= d;
  *y ^= d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq $0x0, -0x30(%rbp)
movsbq -0x11(%rbp), %rcx
movq -0x30(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
xorq (%rcx), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
andq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
xorq (%rax), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
xorq (%rax), %rcx
movq %rcx, (%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/controlbits.c
// Function: invert
static void invert(int n,uint32_t ip[n],uint32_t pi[n])
{
  int i;

  for (i = 0;i < n;i++)
    ip[i] = i;

  composeinv(n,ip,ip,pi);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x939b
movl -0x1c(%rbp), %edx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x937a
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x93c0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/controlbits.c
// Function: composeinv
static void composeinv(int n,uint32_t y[n],uint32_t x[n],uint32_t pi[n]) /* // NC */
{
  int i;
  uint32_t t[n];

  for (i = 0;i < n;++i) 
    t[i] = x[i] | (pi[i] << 16);

  sort(n,t);

  for (i = 0;i < n;++i)
    y[i] = t[i] & 0xFFFF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl -0x4(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x30(%rbp)
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x40(%rbp)
movq %rcx, %rsp
movq %rax, -0x38(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x943e
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq -0x24(%rbp), %rdx
movl (%rcx,%rdx,4), %edx
movq -0x20(%rbp), %rcx
movslq -0x24(%rbp), %rsi
movl (%rcx,%rsi,4), %ecx
shll $0x10, %ecx
orl %ecx, %edx
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x9405
movq -0x40(%rbp), %rsi
movl -0x4(%rbp), %edi
callq 0x9580
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x9480
movq -0x40(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %edx
andl $0xffff, %edx           # imm = 0xFFFF
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x9451
movq -0x30(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/controlbits.c
// Function: flow
static void flow(int w, uint32_t *x, uint32_t *y, const int t)
{
  bit m0;
  bit m1;

  uint32_t b;
  uint32_t y_copy = *y;

  m0 = is_smaller(*y & ((1<<w)-1), *x & ((1<<w)-1));
  m1 = is_smaller(0, t);

  cswap(x, &y_copy, m0);
  b = m0 & m1;
  *x ^= b << w;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %edi
movl -0x4(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
andl %eax, %edi
movq -0x10(%rbp), %rax
movl (%rax), %esi
movl -0x4(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
andl %eax, %esi
callq 0x9710
movb %al, -0x1d(%rbp)
movl -0x1c(%rbp), %esi
xorl %edi, %edi
callq 0x9710
movb %al, -0x1e(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movsbl -0x1d(%rbp), %edx
callq 0x9530
movsbl -0x1d(%rbp), %eax
movsbl -0x1e(%rbp), %ecx
andl %ecx, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x4(%rbp), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
xorl (%rax), %ecx
movl %ecx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/controlbits.c
// Function: cswap
static void cswap(uint32_t *x,uint32_t *y,bit swap)
{
  uint32_t m;
  uint32_t d;

  m = swap; 
  m = 0 - m;

  d = (*x ^ *y);
  d &= m;
  *x ^= d;
  *y ^= d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movsbl -0x11(%rbp), %eax
movl %eax, -0x18(%rbp)
xorl %eax, %eax
subl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
xorl (%rcx), %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
andl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
xorl (%rax), %ecx
movl %ecx, (%rax)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
xorl (%rax), %ecx
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/controlbits.c
// Function: sort
static void sort(int n, uint32_t x[n])
{
  if (n <= 1) return;
  sort(n/2,x);
  sort(n/2,x + n/2);
  merge(n/2,x,1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x1, -0x4(%rbp)
jg 0x9597
jmp 0x95f2
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
movq -0x10(%rbp), %rsi
callq 0x9580
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
movq -0x10(%rbp), %rsi
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cltq
shlq $0x2, %rax
addq %rax, %rsi
callq 0x9580
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x9600
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/controlbits.c
// Function: merge
static void merge(int n,uint32_t x[n],int step)
{
  int i;
  if (n == 1)
    minmax(&x[0],&x[step]);
  else {
    merge(n / 2,x,step * 2);
    merge(n / 2,x + step,step * 2);
    for (i = 1;i < 2*n-1;i += 2)
      minmax(&x[i * step],&x[(i + 1) * step]);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpl $0x1, -0x4(%rbp)
jne 0x9635
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x96d0
jmp 0x96c9
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
shll %edx
callq 0x9600
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
movl -0x14(%rbp), %edx
shll %edx
callq 0x9600
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x4(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x96c7
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %eax
imull -0x14(%rbp), %eax
cltq
shlq $0x2, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x18(%rbp), %eax
addl $0x1, %eax
imull -0x14(%rbp), %eax
cltq
shlq $0x2, %rax
addq %rax, %rsi
callq 0x96d0
movl -0x18(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x18(%rbp)
jmp 0x967d
jmp 0x96c9
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/controlbits.c
// Function: is_smaller
static bit is_smaller(uint32_t a, uint32_t b)
{
  uint32_t ret = 0;

  ret = a - b;
  ret >>= 31;

  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl -0x4(%rbp), %eax
subl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
shrl $0x1f, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/crypto_hash_sha512.c
// Function: crypto_hash_sha512
int crypto_hash_sha512(unsigned char *o,const unsigned char *m, unsigned long long n) {

    long long i;
    unsigned char x[256];
    unsigned long long b = n;
    unsigned long long h[8] = {
        0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL,
        0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL
    };

    blocks(h, m, n);
    m += n;
    n &= 127;
    m -= n;

    for (i = 0; i < sizeof x; ++i) x[i] = 0;
    for (i = 0; i < n; ++i) x[i] = m[i];
    x[n] = 128;

    n = 256 - 128 * (n < 112);
    x[n - 9] = b >> 61;
    store64_bigendian(x + n - 8, b << 3);
    blocks(h, x, n);

    for (i = 0; i < 8; ++i) store64_bigendian(o + 8 * i, h[i]);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x170(%rbp), %rdi
leaq 0x5970(%rip), %rsi      # 0xf0e0
movl $0x40, %edx
callq 0x10a0
leaq -0x170(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x98e0
movq -0x18(%rbp), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
andq $0x7f, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x100, -0x20(%rbp)     # imm = 0x100
jae 0x97e6
movq -0x20(%rbp), %rax
movb $0x0, -0x120(%rbp,%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x97c2
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x981c
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movb (%rax,%rcx), %cl
movq -0x20(%rbp), %rax
movb %cl, -0x120(%rbp,%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x97ee
movq -0x18(%rbp), %rax
movb $-0x80, -0x120(%rbp,%rax)
cmpq $0x70, -0x18(%rbp)
setb %al
andb $0x1, %al
movzbl %al, %ecx
shll $0x7, %ecx
movl $0x100, %eax            # imm = 0x100
subl %ecx, %eax
cltq
movq %rax, -0x18(%rbp)
movq -0x128(%rbp), %rax
shrq $0x3d, %rax
movb %al, %cl
movq -0x18(%rbp), %rax
subq $0x9, %rax
movb %cl, -0x120(%rbp,%rax)
leaq -0x120(%rbp), %rdi
addq -0x18(%rbp), %rdi
addq $-0x8, %rdi
movq -0x128(%rbp), %rsi
shlq $0x3, %rsi
callq 0x9cb0
leaq -0x170(%rbp), %rdi
leaq -0x120(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x98e0
movq $0x0, -0x20(%rbp)
cmpq $0x8, -0x20(%rbp)
jge 0x98d4
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rax
movq -0x170(%rbp,%rax,8), %rsi
callq 0x9cb0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x989f
xorl %eax, %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/crypto_hash_sha512.c
// Function: load64_bigendian
static unsigned long long load64_bigendian(const unsigned char *x) {

    unsigned long long y = 0;
    long long i;

    for (i = 0; i < 8; ++i) y = (y << 8) | x[i];
    return y;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x8, -0x18(%rbp)
jge 0x9d48
movq -0x10(%rbp), %rax
shlq $0x8, %rax
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x9d18
movq -0x10(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/die.c
// Function: die_usage
void die_usage(const char *name, const char *why, const char *usage) {
    cleanup();
    outs(name);
    outs(": usage: ");
    outs(name);
    outs(" ");
    outs(usage);
    outs("\n");
    outs(name);
    outs(": fatal: ");
    outs(why);
    outs(": ");
    outs(e_str(errno));
    outs("\n");
    flush();
    _exit(111);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
callq 0x1220
movq -0x8(%rbp), %rdi
callq 0xa290
leaq 0x51a7(%rip), %rdi      # 0xf3a0
callq 0xa290
movq -0x8(%rbp), %rdi
callq 0xa290
leaq 0x519a(%rip), %rdi      # 0xf3a8
callq 0xa290
movq -0x18(%rbp), %rdi
callq 0xa290
leaq 0x5187(%rip), %rdi      # 0xf3aa
callq 0xa290
movq -0x8(%rbp), %rdi
callq 0xa290
leaq 0x5174(%rip), %rdi      # 0xf3ac
callq 0xa290
movq -0x10(%rbp), %rdi
callq 0xa290
leaq 0x515a(%rip), %rdi      # 0xf3a7
callq 0xa290
callq 0x1040
movl (%rax), %edi
callq 0xa440
movq %rax, %rdi
callq 0xa290
leaq 0x513d(%rip), %rdi      # 0xf3aa
callq 0xa290
callq 0xa310
movl $0x6f, %edi
callq 0x1050
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/die.c
// Function: outs
static void outs(const char *x) {

    long long i;

    for(i = 0; x[i]; ++i) {
        if (buflen >= sizeof buf) flush();
        buf[buflen++] = x[i];
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0xa2fc
cmpq $0x100, 0x253873(%rip) # imm = 0x100
jb 0xa2c4
callq 0xa310
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movb (%rax,%rcx), %dl
movq 0x25385a(%rip), %rcx    # 0x25db30
movq %rcx, %rax
addq $0x1, %rax
movq %rax, 0x25384c(%rip)    # 0x25db30
leaq 0x253855(%rip), %rax    # 0x25db40
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xa2a4
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/die.c
// Function: die_temp
void die_temp(const char *name, const char *why) {
    cleanup();
    outs(name);
    outs(": fatal: ");
    outs(why);
    if (errno) {
        outs(": ");
        outs(e_str(errno));
    }
    outs("\n");
    flush();
    _exit(111);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x1220
movq -0x8(%rbp), %rdi
callq 0xa290
leaq 0x5037(%rip), %rdi      # 0xf3ac
callq 0xa290
movq -0x10(%rbp), %rdi
callq 0xa290
callq 0x1040
cmpl $0x0, (%rax)
je 0xa3ad
leaq 0x5013(%rip), %rdi      # 0xf3a7
callq 0xa290
callq 0x1040
movl (%rax), %edi
callq 0xa440
movq %rax, %rdi
callq 0xa290
leaq 0x4ff6(%rip), %rdi      # 0xf3aa
callq 0xa290
callq 0xa310
movl $0x6f, %edi
callq 0x1050
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/die.c
// Function: die_perm
void die_perm(const char *name, const char *why) {
    cleanup();
    outs(name);
    outs(": fatal: ");
    outs(why);
    outs("\n");
    flush();
    _exit(100);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x1220
movq -0x8(%rbp), %rdi
callq 0xa290
leaq 0x4fb7(%rip), %rdi      # 0xf3ac
callq 0xa290
movq -0x10(%rbp), %rdi
callq 0xa290
leaq 0x4fa0(%rip), %rdi      # 0xf3aa
callq 0xa290
callq 0xa310
movl $0x64, %edi
callq 0x1050
nop
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/fsyncfd.c
// Function: fsyncfd
int fsyncfd(int fd) {

    struct stat st;

    if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode)) {
        if (fsync(fd) == -1) return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %edi
leaq -0x98(%rbp), %rsi
callq 0x1110
cmpl $0x0, %eax
jne 0xb1c9
movl -0x80(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
jne 0xb1c9
movl -0x8(%rbp), %edi
callq 0x10e0
cmpl $-0x1, %eax
jne 0xb1c7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb1d0
jmp 0xb1c9
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/gf.c
// Function: gf_iszero
gf gf_iszero(gf a)
{
	uint32_t t = a;

	t -= 1;
	t >>= 19;

	return (gf) t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0x2(%rbp)
movzwl -0x2(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
shrl $0x13, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/gf.c
// Function: gf_mul
gf gf_mul(gf in0, gf in1)
{
	int i;

	uint64_t tmp;
	uint64_t t0;
	uint64_t t1;
	uint64_t t;

	t0 = in0;
	t1 = in1;

	tmp = t0 * (t1 & 1);

	for (i = 1; i < GFBITS; i++)
		tmp ^= (t0 * (t1 & (1 << i)));

	/* // */

	t = tmp & 0x1FF0000;
	tmp ^= (t >> 9) ^ (t >> 10) ^ (t >> 12) ^ (t >> 13);

	t = tmp & 0x000E000;
	tmp ^= (t >> 9) ^ (t >> 10) ^ (t >> 12) ^ (t >> 13);

	return tmp & GFMASK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %si, %ax
movw %di, %cx
movw %cx, -0x2(%rbp)
movw %ax, -0x4(%rbp)
movzwl -0x2(%rbp), %eax
movq %rax, -0x18(%rbp)
movzwl -0x4(%rbp), %eax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
andq $0x1, %rcx
imulq %rcx, %rax
movq %rax, -0x10(%rbp)
movl $0x1, -0x8(%rbp)
cmpl $0xd, -0x8(%rbp)
jge 0xb2aa
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x30(%rbp)
movl -0x8(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movq -0x30(%rbp), %rcx
movslq %edx, %rdx
andq %rdx, %rcx
imulq %rcx, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xb26d
movq -0x10(%rbp), %rax
andq $0x1ff0000, %rax        # imm = 0x1FF0000
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
shrq $0x9, %rax
movq -0x28(%rbp), %rcx
shrq $0xa, %rcx
xorq %rcx, %rax
movq -0x28(%rbp), %rcx
shrq $0xc, %rcx
xorq %rcx, %rax
movq -0x28(%rbp), %rcx
shrq $0xd, %rcx
xorq %rcx, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
andq $0xe000, %rax           # imm = 0xE000
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
shrq $0x9, %rax
movq -0x28(%rbp), %rcx
shrq $0xa, %rcx
xorq %rcx, %rax
movq -0x28(%rbp), %rcx
shrq $0xc, %rcx
xorq %rcx, %rax
movq -0x28(%rbp), %rcx
shrq $0xd, %rcx
xorq %rcx, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
andq $0x1fff, %rax           # imm = 0x1FFF
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/gf.c
// Function: gf_mul2
uint64_t gf_mul2(gf a, gf b0, gf b1)
{
	int i;

	uint64_t tmp=0;
	uint64_t t0;
	uint64_t t1;
	uint64_t t;
	uint64_t mask = 0x0000000100000001;

	t0 = a;
	t1 = b1;
	t1 = (t1 << 32) | b0;
	
	for (i = 0; i < GFBITS; i++)
	{
		tmp ^= t0 * (t1 & mask);
		mask += mask;
	}

	/* // */

	t = tmp & 0x01FF000001FF0000;
	tmp ^= (t >> 9) ^ (t >> 10) ^ (t >> 12) ^ (t >> 13);

	t = tmp & 0x0000E0000000E000;
	tmp ^= (t >> 9) ^ (t >> 10) ^ (t >> 12) ^ (t >> 13);

	return tmp & 0x00001FFF00001FFF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %dx, %ax
movw %si, %cx
movw %di, %dx
movw %dx, -0x2(%rbp)
movw %cx, -0x4(%rbp)
movw %ax, -0x6(%rbp)
movq $0x0, -0x18(%rbp)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, -0x38(%rbp)
movzwl -0x2(%rbp), %eax
movq %rax, -0x20(%rbp)
movzwl -0x6(%rbp), %eax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
shlq $0x20, %rax
movzwl -0x4(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0xd, -0xc(%rbp)
jge 0xb3ce
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
andq -0x38(%rbp), %rcx
imulq %rcx, %rax
xorq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xb399
movabsq $0x1ff000001ff0000, %rax # imm = 0x1FF000001FF0000
andq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
shrq $0x9, %rax
movq -0x30(%rbp), %rcx
shrq $0xa, %rcx
xorq %rcx, %rax
movq -0x30(%rbp), %rcx
shrq $0xc, %rcx
xorq %rcx, %rax
movq -0x30(%rbp), %rcx
shrq $0xd, %rcx
xorq %rcx, %rax
xorq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movabsq $0xe0000000e000, %rax   # imm = 0xE0000000E000
andq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
shrq $0x9, %rax
movq -0x30(%rbp), %rcx
shrq $0xa, %rcx
xorq %rcx, %rax
movq -0x30(%rbp), %rcx
shrq $0xc, %rcx
xorq %rcx, %rax
movq -0x30(%rbp), %rcx
shrq $0xd, %rcx
xorq %rcx, %rax
xorq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movabsq $0x1fff00001fff, %rax   # imm = 0x1FFF00001FFF
andq -0x18(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/gf.c
// Function: gf_frac
gf gf_frac(gf den, gf num)
{
	gf tmp_11;
	gf tmp_1111;
	gf out;

	tmp_11 = gf_sqmul(den, den); /* // 11 */
	tmp_1111 = gf_sq2mul(tmp_11, tmp_11); /* // 1111 */
	out = gf_sq2(tmp_1111); 
	out = gf_sq2mul(out, tmp_1111); /* // 11111111 */
	out = gf_sq2(out);
	out = gf_sq2mul(out, tmp_1111); /* // 111111111111 */

	return gf_sqmul(out, num); /* // 1111111111110 */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %si, %ax
movw %di, %cx
movw %cx, -0x2(%rbp)
movw %ax, -0x4(%rbp)
movw -0x2(%rbp), %ax
movzwl %ax, %edi
movzwl -0x2(%rbp), %esi
callq 0xb510
movw %ax, -0x6(%rbp)
movw -0x6(%rbp), %ax
movzwl %ax, %edi
movzwl -0x6(%rbp), %esi
callq 0xb6a0
movw %ax, -0x8(%rbp)
movzwl -0x8(%rbp), %edi
callq 0xb870
movw %ax, -0xa(%rbp)
movw -0xa(%rbp), %ax
movzwl %ax, %edi
movzwl -0x8(%rbp), %esi
callq 0xb6a0
movw %ax, -0xa(%rbp)
movzwl -0xa(%rbp), %edi
callq 0xb870
movw %ax, -0xa(%rbp)
movw -0xa(%rbp), %ax
movzwl %ax, %edi
movzwl -0x8(%rbp), %esi
callq 0xb6a0
movw %ax, -0xa(%rbp)
movw -0xa(%rbp), %ax
movzwl %ax, %edi
movzwl -0x4(%rbp), %esi
callq 0xb510
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/gf.c
// Function: gf_sqmul
static inline gf gf_sqmul(gf in, gf m)
{
	int i;

	uint64_t x;
	uint64_t t0;
	uint64_t t1;
	uint64_t t;

	const uint64_t M[] = {0x0000001FF0000000,
	                      0x000000000FF80000, 
	                      0x000000000007E000}; 

	t0 = in;
	t1 = m;

	x = (t1 << 6) * (t0 & (1 << 6));
	
	t0 ^= (t0 << 7);

	x ^= (t1 * (t0 & (0x04001)));
	x ^= (t1 * (t0 & (0x08002))) << 1;
	x ^= (t1 * (t0 & (0x10004))) << 2;
	x ^= (t1 * (t0 & (0x20008))) << 3;
	x ^= (t1 * (t0 & (0x40010))) << 4;
	x ^= (t1 * (t0 & (0x80020))) << 5;

	for (i = 0; i < 3; i++)
	{
		t = x & M[i];
		x ^= (t >> 9) ^ (t >> 10) ^ (t >> 12) ^ (t >> 13);
	}

	return x & GFMASK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %si, %ax
movw %di, %cx
movw %cx, -0x2(%rbp)
movw %ax, -0x4(%rbp)
movq 0x4617(%rip), %rax      # 0xfb40
movq %rax, -0x40(%rbp)
movq 0x4614(%rip), %rax      # 0xfb48
movq %rax, -0x38(%rbp)
movq 0x4611(%rip), %rax      # 0xfb50
movq %rax, -0x30(%rbp)
movzwl -0x2(%rbp), %eax
movq %rax, -0x18(%rbp)
movzwl -0x4(%rbp), %eax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
shlq $0x6, %rax
movq -0x18(%rbp), %rcx
andq $0x40, %rcx
imulq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
shlq $0x7, %rax
xorq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
andq $0x4001, %rcx           # imm = 0x4001
imulq %rcx, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
andq $0x8002, %rcx           # imm = 0x8002
imulq %rcx, %rax
shlq %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
andq $0x10004, %rcx          # imm = 0x10004
imulq %rcx, %rax
shlq $0x2, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
andq $0x20008, %rcx          # imm = 0x20008
imulq %rcx, %rax
shlq $0x3, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
andq $0x40010, %rcx          # imm = 0x40010
imulq %rcx, %rax
shlq $0x4, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
andq $0x80020, %rcx          # imm = 0x80020
imulq %rcx, %rax
shlq $0x5, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x3, -0x8(%rbp)
jge 0xb68a
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
andq -0x40(%rbp,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
shrq $0x9, %rax
movq -0x28(%rbp), %rcx
shrq $0xa, %rcx
xorq %rcx, %rax
movq -0x28(%rbp), %rcx
shrq $0xc, %rcx
xorq %rcx, %rax
movq -0x28(%rbp), %rcx
shrq $0xd, %rcx
xorq %rcx, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xb637
movq -0x10(%rbp), %rax
andq $0x1fff, %rax           # imm = 0x1FFF
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/gf.c
// Function: gf_sq2
static inline gf gf_sq2(gf in)
{
	int i;

	const uint64_t B[] = {0x1111111111111111, 
	                      0x0303030303030303, 
	                      0x000F000F000F000F, 
	                      0x000000FF000000FF};

	const uint64_t M[] = {0x0001FF0000000000, 
	                      0x000000FF80000000, 
	                      0x000000007FC00000, 
	                      0x00000000003FE000};

	uint64_t x = in; 
	uint64_t t;

	x = (x | (x << 24)) & B[3];
	x = (x | (x << 12)) & B[2];
	x = (x | (x << 6)) & B[1];
	x = (x | (x << 3)) & B[0];

	for (i = 0; i < 4; i++)
	{
		t = x & M[i];
		x ^= (t >> 9) ^ (t >> 10) ^ (t >> 12) ^ (t >> 13);
	}

	return x & GFMASK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0x2(%rbp)
movq 0x42de(%rip), %rax      # 0xfb60
movq %rax, -0x30(%rbp)
movq 0x42db(%rip), %rax      # 0xfb68
movq %rax, -0x28(%rbp)
movq 0x42d8(%rip), %rax      # 0xfb70
movq %rax, -0x20(%rbp)
movq 0x42d5(%rip), %rax      # 0xfb78
movq %rax, -0x18(%rbp)
movq 0x42d2(%rip), %rax      # 0xfb80
movq %rax, -0x50(%rbp)
movq 0x42cf(%rip), %rax      # 0xfb88
movq %rax, -0x48(%rbp)
movq 0x42cc(%rip), %rax      # 0xfb90
movq %rax, -0x40(%rbp)
movq 0x42c9(%rip), %rax      # 0xfb98
movq %rax, -0x38(%rbp)
movzwl -0x2(%rbp), %eax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x58(%rbp), %rcx
shlq $0x18, %rcx
orq %rcx, %rax
andq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x58(%rbp), %rcx
shlq $0xc, %rcx
orq %rcx, %rax
andq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x58(%rbp), %rcx
shlq $0x6, %rcx
orq %rcx, %rax
andq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x58(%rbp), %rcx
shlq $0x3, %rcx
orq %rcx, %rax
andq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x4, -0x8(%rbp)
jge 0xb991
movq -0x58(%rbp), %rax
movslq -0x8(%rbp), %rcx
andq -0x50(%rbp,%rcx,8), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
shrq $0x9, %rax
movq -0x60(%rbp), %rcx
shrq $0xa, %rcx
xorq %rcx, %rax
movq -0x60(%rbp), %rcx
shrq $0xc, %rcx
xorq %rcx, %rax
movq -0x60(%rbp), %rcx
shrq $0xd, %rcx
xorq %rcx, %rax
xorq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xb93e
movq -0x58(%rbp), %rax
andq $0x1fff, %rax           # imm = 0x1FFF
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/gf.c
// Function: GF_mul
void GF_mul(gf *out, gf *in0, gf *in1)
{
	int i, j;

	gf prod[255];

	for (i = 0; i < 255; i++)
		prod[i] = 0;

	for (i = 0; i < 128; i++)
		for (j = 0; j < 128; j++)
			prod[i+j] ^= gf_mul(in0[i], in1[j]);

	/* // */
 
	for (i = 254; i >= 128; i--)
	{
		prod[i - 123] ^= gf_mul(prod[i], (gf) 7682);
		prod[i - 125] ^= gf_mul(prod[i], (gf) 2159);
		prod[i - 128] ^= gf_mul(prod[i], (gf) 3597);
	}

	for (i = 0; i < 128; i++)
		out[i] = prod[i];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0xff, -0x1c(%rbp)
jge 0xba10
movslq -0x1c(%rbp), %rax
movw $0x0, -0x220(%rbp,%rax,2)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xb9ee
movl $0x0, -0x1c(%rbp)
cmpl $0x80, -0x1c(%rbp)
jge 0xba85
movl $0x0, -0x20(%rbp)
cmpl $0x80, -0x20(%rbp)
jge 0xba78
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movw (%rax,%rcx,2), %dx
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzwl %dx, %edi
movzwl (%rax,%rcx,2), %esi
callq 0xb230
movzwl %ax, %edx
movl -0x1c(%rbp), %eax
addl -0x20(%rbp), %eax
cltq
movzwl -0x220(%rbp,%rax,2), %ecx
xorl %edx, %ecx
movw %cx, -0x220(%rbp,%rax,2)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xba27
jmp 0xba7a
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xba17
movl $0xfe, -0x1c(%rbp)
cmpl $0x80, -0x1c(%rbp)
jl 0xbb42
movslq -0x1c(%rbp), %rax
movl $0x1e02, %esi           # imm = 0x1E02
movzwl -0x220(%rbp,%rax,2), %edi
callq 0xb230
movzwl %ax, %edx
movl -0x1c(%rbp), %eax
subl $0x7b, %eax
cltq
movzwl -0x220(%rbp,%rax,2), %ecx
xorl %edx, %ecx
movw %cx, -0x220(%rbp,%rax,2)
movslq -0x1c(%rbp), %rax
movl $0x86f, %esi            # imm = 0x86F
movzwl -0x220(%rbp,%rax,2), %edi
callq 0xb230
movzwl %ax, %edx
movl -0x1c(%rbp), %eax
subl $0x7d, %eax
cltq
movzwl -0x220(%rbp,%rax,2), %ecx
xorl %edx, %ecx
movw %cx, -0x220(%rbp,%rax,2)
movslq -0x1c(%rbp), %rax
movl $0xe0d, %esi            # imm = 0xE0D
movzwl -0x220(%rbp,%rax,2), %edi
callq 0xb230
movzwl %ax, %edx
movl -0x1c(%rbp), %eax
subl $0x80, %eax
cltq
movzwl -0x220(%rbp,%rax,2), %ecx
xorl %edx, %ecx
movw %cx, -0x220(%rbp,%rax,2)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xba8c
movl $0x0, -0x1c(%rbp)
cmpl $0x80, -0x1c(%rbp)
jge 0xbb75
movslq -0x1c(%rbp), %rax
movw -0x220(%rbp,%rax,2), %dx
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xbb49
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/memreadall.c
// Function: memreadall
unsigned char *memreadall(unsigned long long *len, int fd) {

    unsigned char *buf = 0;
    unsigned char *newbuf;
    unsigned long long bufalloc = 0;
    unsigned long long pos = 0;
    long long r;

    for (;;) {
        if (bufalloc <= pos + CHUNK) {
            while (bufalloc <= pos + CHUNK) {
                bufalloc = bufalloc * 2 + CHUNK;
                if (bufalloc != (unsigned long long)(size_t)bufalloc) goto nomem;
                if (bufalloc >= MAX) goto nomem;
            }
            newbuf = realloc(buf, bufalloc);
            if (!newbuf) goto nomem;
            buf = newbuf;
        }

        r = read(fd, buf + pos, CHUNK);
        if (r == -1) { free(buf); return 0; }
        if (r == 0) { *len = pos; return buf; }
        pos += r;
    }
    

nomem:
    errno = ENOMEM;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
addq $0x1000, %rcx           # imm = 0x1000
cmpq %rcx, %rax
ja 0xbc7a
jmp 0xbc0d
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
addq $0x1000, %rcx           # imm = 0x1000
cmpq %rcx, %rax
ja 0xbc58
movq -0x30(%rbp), %rax
shlq %rax
addq $0x1000, %rax           # imm = 0x1000
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0xbc41
jmp 0xbcda
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
cmpq %rax, -0x30(%rbp)
jb 0xbc56
jmp 0xbcda
jmp 0xbc0d
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x10c0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xbc72
jmp 0xbcda
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %edi
movq -0x20(%rbp), %rsi
addq -0x38(%rbp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x1090
movq %rax, -0x40(%rbp)
cmpq $-0x1, -0x40(%rbp)
jne 0xbcad
movq -0x20(%rbp), %rdi
callq 0x1030
movq $0x0, -0x8(%rbp)
jmp 0xbced
cmpq $0x0, -0x40(%rbp)
jne 0xbcc9
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xbced
movq -0x40(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xbbf7
callq 0x1040
movl $0xc, (%rax)
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/operations.c
// Function: crypto_kem_mceliece8192128sha512_enc
int crypto_kem_mceliece8192128sha512_enc(
       unsigned char *c,
       unsigned char *key,
       const unsigned char *pk
)
{
	unsigned char two_e[ 1 + SYS_N/8 ] = {2};
	unsigned char *e = two_e + 1;
	unsigned char one_ec[ 1 + SYS_N/8 + (SYND_BYTES + 32) ] = {1};
	unsigned char conf[64];
    long long i;

	/* // */

	encrypt(c, pk, e);

	crypto_hash_sha512(conf, two_e, sizeof(two_e)); 
    for (i = 0; i < 32; ++i) c[SYND_BYTES + i] = conf[i];

	memcpy(one_ec + 1,e,SYS_N/8);
	memcpy(one_ec + 1 + SYS_N/8,c,SYND_BYTES + 32);

	crypto_hash_sha512(key, one_ec, sizeof one_ec);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x970, %rsp            # imm = 0x970
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x420(%rbp), %rdi
xorl %esi, %esi
movl $0x401, %edx            # imm = 0x401
callq 0x1070
movb $0x2, -0x420(%rbp)
leaq -0x420(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x428(%rbp)
leaq -0x920(%rbp), %rdi
xorl %esi, %esi
movl $0x4f1, %edx            # imm = 0x4F1
callq 0x1070
movb $0x1, -0x920(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x428(%rbp), %rdx
callq 0xaf10
leaq -0x960(%rbp), %rdi
leaq -0x420(%rbp), %rsi
movl $0x401, %edx            # imm = 0x401
callq 0x9740
movq $0x0, -0x968(%rbp)
cmpq $0x20, -0x968(%rbp)
jge 0xbdd5
movq -0x968(%rbp), %rax
movb -0x960(%rbp,%rax), %dl
movq -0x8(%rbp), %rax
movq -0x968(%rbp), %rcx
addq $0xd0, %rcx
movb %dl, (%rax,%rcx)
movq -0x968(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x968(%rbp)
jmp 0xbd94
leaq -0x920(%rbp), %rdi
addq $0x1, %rdi
movq -0x428(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x10a0
leaq -0x920(%rbp), %rdi
addq $0x1, %rdi
addq $0x400, %rdi            # imm = 0x400
movq -0x8(%rbp), %rsi
movl $0xf0, %edx
callq 0x10a0
movq -0x10(%rbp), %rdi
leaq -0x920(%rbp), %rsi
movl $0x4f1, %edx            # imm = 0x4F1
callq 0x9740
xorl %eax, %eax
addq $0x970, %rsp            # imm = 0x970
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/operations.c
// Function: crypto_kem_mceliece8192128sha512_keypair
int crypto_kem_mceliece8192128sha512_keypair
(
       unsigned char *pk,
       unsigned char *sk 
)
{
	while (1)
	{
		sk_gen(sk);

		if (pk_gen(pk, sk + SYS_N/8) == 0)
			break;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd650
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x400, %rsi            # imm = 0x400
callq 0xc060
cmpl $0x0, %eax
jne 0xc054
jmp 0xc056
jmp 0xc030
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/poly1305.c
// Function: poly1305_init
void poly1305_init(poly1305_ctx *ctx, const unsigned char *k) {

    /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */
    ctx->r[0] = (unpack(k +  0)     ) & 0x3ffffff;
    ctx->r[1] = (unpack(k +  3) >> 2) & 0x3ffff03;
    ctx->r[2] = (unpack(k +  6) >> 4) & 0x3ffc0ff;
    ctx->r[3] = (unpack(k +  9) >> 6) & 0x3f03fff;
    ctx->r[4] = (unpack(k + 12) >> 8) & 0x00fffff;

    ctx->s[1] = ctx->r[1] * 5;
    ctx->s[2] = ctx->r[2] * 5;
    ctx->s[3] = ctx->r[3] * 5;
    ctx->s[4] = ctx->r[4] * 5;

    /* h = 0 */
    ctx->h[0] = 0;
    ctx->h[1] = 0;
    ctx->h[2] = 0;
    ctx->h[3] = 0;
    ctx->h[4] = 0;

    ctx->pad[0] = unpack(k + 16);
    ctx->pad[1] = unpack(k + 20);
    ctx->pad[2] = unpack(k + 24);
    ctx->pad[3] = unpack(k + 28);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xc8a0
movq %rax, %rcx
andq $0x3ffffff, %rcx        # imm = 0x3FFFFFF
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rdi
addq $0x3, %rdi
callq 0xc8a0
movq %rax, %rcx
shrq $0x2, %rcx
andq $0x3ffff03, %rcx        # imm = 0x3FFFF03
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rdi
addq $0x6, %rdi
callq 0xc8a0
movq %rax, %rcx
shrq $0x4, %rcx
andq $0x3ffc0ff, %rcx        # imm = 0x3FFC0FF
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rdi
addq $0x9, %rdi
callq 0xc8a0
movq %rax, %rcx
shrq $0x6, %rcx
andq $0x3f03fff, %rcx        # imm = 0x3F03FFF
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rdi
addq $0xc, %rdi
callq 0xc8a0
movq %rax, %rcx
shrq $0x8, %rcx
andq $0xfffff, %rcx          # imm = 0xFFFFF
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rax
imulq $0x5, 0x30(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x8(%rbp), %rax
imulq $0x5, 0x38(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x8(%rbp), %rax
imulq $0x5, 0x40(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rax
imulq $0x5, 0x48(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0xc8a0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x10(%rbp), %rdi
addq $0x14, %rdi
callq 0xc8a0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0xc8a0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x88(%rax)
movq -0x10(%rbp), %rdi
addq $0x1c, %rdi
callq 0xc8a0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x90(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/poly1305.c
// Function: poly1305
void poly1305(unsigned char *o, const unsigned char *m, unsigned long long n, const unsigned char *k) {

    poly1305_ctx ctx;

    poly1305_init(&ctx, k);
    poly1305_blocks(&ctx, m, n);
    poly1305_final(&ctx, o);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0xc6f0
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0xb8(%rbp), %rdi
callq 0xc8e0
movq -0x8(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0xce50
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/poly1305.c
// Function: poly1305_verify
int poly1305_verify(const unsigned char *h, const unsigned char *in, unsigned long long l, const unsigned char *k) {

    unsigned char correct[16];
    unsigned int d = 0;
    long long i;

    poly1305(correct, in, l, k);

    for (i = 0; i < 16; ++i) d |= correct[i] ^ h[i];
    return (1 & ((d - 1) >> 8)) - 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x34(%rbp)
leaq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0xd2c0
movq $0x0, -0x40(%rbp)
cmpq $0x10, -0x40(%rbp)
jge 0xd38e
movq -0x40(%rbp), %rax
movzbl -0x30(%rbp,%rax), %eax
movq -0x8(%rbp), %rcx
movq -0x40(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
xorl %ecx, %eax
orl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xd35c
movl -0x34(%rbp), %eax
subl $0x1, %eax
shrl $0x8, %eax
andl $0x1, %eax
subl $0x1, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/randombytes.c
// Function: randombytes
void randombytes(void *xv, unsigned long long xlen) {

    long long i;
    unsigned char *x = xv;

    if (fd == -1) {
        for (;;) {
#ifdef O_CLOEXEC
            fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC);
#else
            fd = open("/dev/urandom", O_RDONLY);
            fcntl(fd, F_SETFD, 1);
#endif
            if (fd != -1) break;
            sleep(1);
        }
    }

    while (xlen > 0) {
        if (xlen < 1048576) i = xlen; else i = 1048576;

        i = read(fd, x, i);
        if (i < 1) {
            sleep(1);
            continue;
        }

        x += i;
        xlen -= i;
    }
    __asm__ __volatile__("" : : "r"(xv) : "memory");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $-0x1, 0x4cd1(%rip)     # 0x120a0
jne 0xd405
jmp 0xd3d3
leaq 0x27c6(%rip), %rdi      # 0xfba0
movl $0x80000, %esi          # imm = 0x80000
movb $0x0, %al
callq 0x10f0
movl %eax, 0x4cb4(%rip)      # 0x120a0
cmpl $-0x1, 0x4cad(%rip)     # 0x120a0
je 0xd3f7
jmp 0xd403
movl $0x1, %edi
callq 0x1100
jmp 0xd3d3
jmp 0xd405
jmp 0xd407
cmpq $0x0, -0x10(%rbp)
jbe 0xd471
cmpq $0x100000, -0x10(%rbp)  # imm = 0x100000
jae 0xd422
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0xd42a
movq $0x100000, -0x18(%rbp)  # imm = 0x100000
movl 0x4c70(%rip), %edi      # 0x120a0
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1090
movq %rax, -0x18(%rbp)
cmpq $0x1, -0x18(%rbp)
jge 0xd454
movl $0x1, %edi
callq 0x1100
jmp 0xd407
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0xd407
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/readblock.c
// Function: readblock
long long readblock(int fd, void *x, long long xlen) {

    long long r;
    char *buf = x;

    while (xlen > 0) {
        r = xlen;
        if (r > 1048576) r = 1048576; 
        r = read(fd, buf, r);
        if (r == 0) break;
        if (r == -1) {
            if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) {
                struct pollfd p;
                p.fd = fd;
                p.events = POLLIN;
                poll(&p, 1, -1);
                continue;
            }
            return -1;
        }
        buf += r; xlen -= r;
    }
    return (buf - (char *)x);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
jle 0xd550
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x100000, -0x28(%rbp)  # imm = 0x100000
jle 0xd4c0
movq $0x100000, -0x28(%rbp)  # imm = 0x100000
movl -0xc(%rbp), %edi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x1090
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xd4dd
jmp 0xd550
cmpq $-0x1, -0x28(%rbp)
jne 0xd530
callq 0x1040
cmpl $0x4, (%rax)
je 0xd502
callq 0x1040
cmpl $0xb, (%rax)
je 0xd502
callq 0x1040
cmpl $0xb, (%rax)
jne 0xd526
movl -0xc(%rbp), %eax
movl %eax, -0x38(%rbp)
movw $0x1, -0x34(%rbp)
leaq -0x38(%rbp), %rdi
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x10d0
jmp 0xd49b
movq $-0x1, -0x8(%rbp)
jmp 0xd55f
movq -0x28(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x20(%rbp)
jmp 0xd49b
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/root.c
// Function: eval
gf eval(gf *f, gf a)
{
	int i;
	gf r;
	
	r = f[ SYS_T ];

	for (i = SYS_T-1; i >= 0; i--)
	{
		r = gf_mul(r, a);
		r = gf_add(r, f[i]);
	}

	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
movw 0x100(%rax), %ax
movw %ax, -0x12(%rbp)
movl $0x7f, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jl 0xd5da
movw -0x12(%rbp), %ax
movzwl %ax, %edi
movzwl -0xa(%rbp), %esi
callq 0xb230
movw %ax, -0x12(%rbp)
movw -0x12(%rbp), %dx
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movzwl %dx, %edi
movzwl (%rax,%rcx,2), %esi
callq 0xb210
movw %ax, -0x12(%rbp)
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xd599
movw -0x12(%rbp), %ax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/sk_gen.c
// Function: sk_gen
int sk_gen(unsigned char *sk)
{
	int i;

	gf g[ SYS_T ]; /* // irreducible polynomial */
	gf a[ SYS_T ]; /* // random element in GF(2^mt) */
	
	while (1)
	{
		randombytes((unsigned char *) a, sizeof(a)); 

		for (i = 0; i < SYS_T; i++) a[i] &= GFMASK;

		if ( irr_gen(g, a) == 0 ) break;
	}

	for (i = 0; i < SYS_T; i++) 
		store2( sk + SYS_N/8 + i*2, g[i] );

	randombytes(sk, SYS_N/8);

	controlbits(sk + SYS_N/8 + IRR_BYTES);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0x8(%rbp)
leaq -0x210(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xd3b0
movl $0x0, -0xc(%rbp)
cmpl $0x80, -0xc(%rbp)
jge 0xd6a5
movslq -0xc(%rbp), %rax
movzwl -0x210(%rbp,%rax,2), %ecx
andl $0x1fff, %ecx           # imm = 0x1FFF
movw %cx, -0x210(%rbp,%rax,2)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xd677
leaq -0x110(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0xd740
cmpl $0x0, %eax
jne 0xd6bf
jmp 0xd6c1
jmp 0xd65f
movl $0x0, -0xc(%rbp)
cmpl $0x80, -0xc(%rbp)
jge 0xd702
movq -0x8(%rbp), %rdi
addq $0x400, %rdi            # imm = 0x400
movl -0xc(%rbp), %eax
shll %eax
cltq
addq %rax, %rdi
movslq -0xc(%rbp), %rax
movzwl -0x110(%rbp,%rax,2), %esi
callq 0xddb0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xd6c8
movq -0x8(%rbp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0xd3b0
movq -0x8(%rbp), %rdi
addq $0x400, %rdi            # imm = 0x400
addq $0x100, %rdi            # imm = 0x100
callq 0x87f0
xorl %eax, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
nopw %cs:(%rax,%rax)