// File: /workspace/github_c_makefile_star2_O0/sbp[P]tweetnacl-tools/tweetnacl.c
// Function: core
sv core(u8 *out,const u8 *in,const u8 *k,const u8 *c,int h)
{
  u32 w[16],x[16],y[16],t[4];
  int i,j,m;

  FOR(i,4) {
    x[5*i] = ld32(c+4*i);
    x[1+i] = ld32(k+4*i);
    x[6+i] = ld32(in+4*i);
    x[11+i] = ld32(k+16+4*i);
  }

  FOR(i,16) y[i] = x[i];

  FOR(i,20) {
    FOR(j,4) {
      FOR(m,4) t[m] = x[(5*j+4*m)%16];
      t[1] ^= L32(t[0]+t[3], 7);
      t[2] ^= L32(t[1]+t[0], 9);
      t[3] ^= L32(t[2]+t[1],13);
      t[0] ^= L32(t[3]+t[2],18);
      FOR(m,4) w[4*j+(j+m)%4] = t[m];
    }
    FOR(m,16) x[m] = w[m];
  }

  if (h) {
    FOR(i,16) x[i] += y[i];
    FOR(i,4) {
      x[5*i] -= ld32(c+4*i);
      x[6+i] -= ld32(in+4*i);
    }
    FOR(i,4) {
      st32(out+4*i,x[5*i]);
      st32(out+16+4*i,x[6+i]);
    }
  } else
    FOR(i,16) st32(out + 4 * i,x[i] + y[i]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl $0x0, -0x1d4(%rbp)
cmpl $0x4, -0x1d4(%rbp)
jge 0x1870
movq -0x20(%rbp), %rdi
movl -0x1d4(%rbp), %eax
shll $0x2, %eax
cltq
addq %rax, %rdi
callq 0x4c60
movq %rax, %rcx
imull $0x5, -0x1d4(%rbp), %eax
cltq
movq %rcx, -0x130(%rbp,%rax,8)
movq -0x18(%rbp), %rdi
movl -0x1d4(%rbp), %eax
shll $0x2, %eax
cltq
addq %rax, %rdi
callq 0x4c60
movq %rax, %rcx
movl -0x1d4(%rbp), %eax
addl $0x1, %eax
cltq
movq %rcx, -0x130(%rbp,%rax,8)
movq -0x10(%rbp), %rdi
movl -0x1d4(%rbp), %eax
shll $0x2, %eax
cltq
addq %rax, %rdi
callq 0x4c60
movq %rax, %rcx
movl -0x1d4(%rbp), %eax
addl $0x6, %eax
cltq
movq %rcx, -0x130(%rbp,%rax,8)
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
movl -0x1d4(%rbp), %eax
shll $0x2, %eax
cltq
addq %rax, %rdi
callq 0x4c60
movq %rax, %rcx
movl -0x1d4(%rbp), %eax
addl $0xb, %eax
cltq
movq %rcx, -0x130(%rbp,%rax,8)
movl -0x1d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d4(%rbp)
jmp 0x1799
movl $0x0, -0x1d4(%rbp)
cmpl $0x10, -0x1d4(%rbp)
jge 0x18b2
movslq -0x1d4(%rbp), %rax
movq -0x130(%rbp,%rax,8), %rcx
movslq -0x1d4(%rbp), %rax
movq %rcx, -0x1b0(%rbp,%rax,8)
movl -0x1d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d4(%rbp)
jmp 0x187a
movl $0x0, -0x1d4(%rbp)
cmpl $0x14, -0x1d4(%rbp)
jge 0x1aa6
movl $0x0, -0x1d8(%rbp)
cmpl $0x4, -0x1d8(%rbp)
jge 0x1a4e
movl $0x0, -0x1dc(%rbp)
cmpl $0x4, -0x1dc(%rbp)
jge 0x1938
imull $0x5, -0x1d8(%rbp), %eax
movl -0x1dc(%rbp), %ecx
shll $0x2, %ecx
addl %ecx, %eax
movl $0x10, %ecx
cltd
idivl %ecx
movslq %edx, %rax
movq -0x130(%rbp,%rax,8), %rcx
movslq -0x1dc(%rbp), %rax
movq %rcx, -0x1d0(%rbp,%rax,8)
movl -0x1dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1dc(%rbp)
jmp 0x18ea
movq -0x1d0(%rbp), %rdi
addq -0x1b8(%rbp), %rdi
movl $0x7, %esi
callq 0x4cc0
xorq -0x1c8(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rdi
addq -0x1d0(%rbp), %rdi
movl $0x9, %esi
callq 0x4cc0
xorq -0x1c0(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x1c0(%rbp), %rdi
addq -0x1c8(%rbp), %rdi
movl $0xd, %esi
callq 0x4cc0
xorq -0x1b8(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rdi
addq -0x1c0(%rbp), %rdi
movl $0x12, %esi
callq 0x4cc0
xorq -0x1d0(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movl $0x0, -0x1dc(%rbp)
cmpl $0x4, -0x1dc(%rbp)
jge 0x1a38
movslq -0x1dc(%rbp), %rax
movq -0x1d0(%rbp,%rax,8), %rcx
movl -0x1d8(%rbp), %eax
shll $0x2, %eax
movl %eax, -0x1e0(%rbp)
movl -0x1d8(%rbp), %eax
addl -0x1dc(%rbp), %eax
movl $0x4, %esi
cltd
idivl %esi
movl -0x1e0(%rbp), %eax
addl %edx, %eax
cltq
movq %rcx, -0xb0(%rbp,%rax,8)
movl -0x1dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1dc(%rbp)
jmp 0x19da
jmp 0x1a3a
movl -0x1d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d8(%rbp)
jmp 0x18d3
movl $0x0, -0x1dc(%rbp)
cmpl $0x10, -0x1dc(%rbp)
jge 0x1a90
movslq -0x1dc(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rcx
movslq -0x1dc(%rbp), %rax
movq %rcx, -0x130(%rbp,%rax,8)
movl -0x1dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1dc(%rbp)
jmp 0x1a58
jmp 0x1a92
movl -0x1d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d4(%rbp)
jmp 0x18bc
cmpl $0x0, -0x24(%rbp)
je 0x1c0f
movl $0x0, -0x1d4(%rbp)
cmpl $0x10, -0x1d4(%rbp)
jge 0x1afa
movslq -0x1d4(%rbp), %rax
movq -0x1b0(%rbp,%rax,8), %rcx
movslq -0x1d4(%rbp), %rax
addq -0x130(%rbp,%rax,8), %rcx
movq %rcx, -0x130(%rbp,%rax,8)
movl -0x1d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d4(%rbp)
jmp 0x1aba
movl $0x0, -0x1d4(%rbp)
cmpl $0x4, -0x1d4(%rbp)
jge 0x1b93
movq -0x20(%rbp), %rdi
movl -0x1d4(%rbp), %eax
shll $0x2, %eax
cltq
addq %rax, %rdi
callq 0x4c60
movq %rax, %rdx
imull $0x5, -0x1d4(%rbp), %eax
cltq
movq -0x130(%rbp,%rax,8), %rcx
subq %rdx, %rcx
movq %rcx, -0x130(%rbp,%rax,8)
movq -0x10(%rbp), %rdi
movl -0x1d4(%rbp), %eax
shll $0x2, %eax
cltq
addq %rax, %rdi
callq 0x4c60
movq %rax, %rdx
movl -0x1d4(%rbp), %eax
addl $0x6, %eax
cltq
movq -0x130(%rbp,%rax,8), %rcx
subq %rdx, %rcx
movq %rcx, -0x130(%rbp,%rax,8)
movl -0x1d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d4(%rbp)
jmp 0x1b04
movl $0x0, -0x1d4(%rbp)
cmpl $0x4, -0x1d4(%rbp)
jge 0x1c0d
movq -0x8(%rbp), %rdi
movl -0x1d4(%rbp), %eax
shll $0x2, %eax
cltq
addq %rax, %rdi
imull $0x5, -0x1d4(%rbp), %eax
cltq
movq -0x130(%rbp,%rax,8), %rsi
callq 0x4d00
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
movl -0x1d4(%rbp), %eax
shll $0x2, %eax
cltq
addq %rax, %rdi
movl -0x1d4(%rbp), %eax
addl $0x6, %eax
cltq
movq -0x130(%rbp,%rax,8), %rsi
callq 0x4d00
movl -0x1d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d4(%rbp)
jmp 0x1b9d
jmp 0x1c6a
movl $0x0, -0x1d4(%rbp)
cmpl $0x10, -0x1d4(%rbp)
jge 0x1c68
movq -0x8(%rbp), %rdi
movl -0x1d4(%rbp), %eax
shll $0x2, %eax
cltq
addq %rax, %rdi
movslq -0x1d4(%rbp), %rax
movq -0x130(%rbp,%rax,8), %rsi
movslq -0x1d4(%rbp), %rax
addq -0x1b0(%rbp,%rax,8), %rsi
callq 0x4d00
movl -0x1d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d4(%rbp)
jmp 0x1c19
jmp 0x1c6a
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
nopw %cs:(%rax,%rax)