// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/salsa208.c
// Function: salsa208
void salsa208(
        unsigned char *out,
  const unsigned char *in,
  const unsigned char *k,
  const unsigned char *c
)
{
  uint32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15;
  uint32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;
  int i;

  j0 = x0 = load_littleendian(c + 0);
  j1 = x1 = load_littleendian(k + 0);
  j2 = x2 = load_littleendian(k + 4);
  j3 = x3 = load_littleendian(k + 8);
  j4 = x4 = load_littleendian(k + 12);
  j5 = x5 = load_littleendian(c + 4);
  j6 = x6 = load_littleendian(in + 0);
  j7 = x7 = load_littleendian(in + 4);
  j8 = x8 = load_littleendian(in + 8);
  j9 = x9 = load_littleendian(in + 12);
  j10 = x10 = load_littleendian(c + 8);
  j11 = x11 = load_littleendian(k + 16);
  j12 = x12 = load_littleendian(k + 20);
  j13 = x13 = load_littleendian(k + 24);
  j14 = x14 = load_littleendian(k + 28);
  j15 = x15 = load_littleendian(c + 12);

  for (i = ROUNDS;i > 0;i -= 2) {
     x4 ^= rotate( x0+x12, 7);
     x8 ^= rotate( x4+ x0, 9);
    x12 ^= rotate( x8+ x4,13);
     x0 ^= rotate(x12+ x8,18);
     x9 ^= rotate( x5+ x1, 7);
    x13 ^= rotate( x9+ x5, 9);
     x1 ^= rotate(x13+ x9,13);
     x5 ^= rotate( x1+x13,18);
    x14 ^= rotate(x10+ x6, 7);
     x2 ^= rotate(x14+x10, 9);
     x6 ^= rotate( x2+x14,13);
    x10 ^= rotate( x6+ x2,18);
     x3 ^= rotate(x15+x11, 7);
     x7 ^= rotate( x3+x15, 9);
    x11 ^= rotate( x7+ x3,13);
    x15 ^= rotate(x11+ x7,18);
     x1 ^= rotate( x0+ x3, 7);
     x2 ^= rotate( x1+ x0, 9);
     x3 ^= rotate( x2+ x1,13);
     x0 ^= rotate( x3+ x2,18);
     x6 ^= rotate( x5+ x4, 7);
     x7 ^= rotate( x6+ x5, 9);
     x4 ^= rotate( x7+ x6,13);
     x5 ^= rotate( x4+ x7,18);
    x11 ^= rotate(x10+ x9, 7);
     x8 ^= rotate(x11+x10, 9);
     x9 ^= rotate( x8+x11,13);
    x10 ^= rotate( x9+ x8,18);
    x12 ^= rotate(x15+x14, 7);
    x13 ^= rotate(x12+x15, 9);
    x14 ^= rotate(x13+x12,13);
    x15 ^= rotate(x14+x13,18);
  }

  x0 += j0;
  x1 += j1;
  x2 += j2;
  x3 += j3;
  x4 += j4;
  x5 += j5;
  x6 += j6;
  x7 += j7;
  x8 += j8;
  x9 += j9;
  x10 += j10;
  x11 += j11;
  x12 += j12;
  x13 += j13;
  x14 += j14;
  x15 += j15;

  store_littleendian(out + 0,x0);
  store_littleendian(out + 4,x1);
  store_littleendian(out + 8,x2);
  store_littleendian(out + 12,x3);
  store_littleendian(out + 16,x4);
  store_littleendian(out + 20,x5);
  store_littleendian(out + 24,x6);
  store_littleendian(out + 28,x7);
  store_littleendian(out + 32,x8);
  store_littleendian(out + 36,x9);
  store_littleendian(out + 40,x10);
  store_littleendian(out + 44,x11);
  store_littleendian(out + 48,x12);
  store_littleendian(out + 52,x13);
  store_littleendian(out + 56,x14);
  store_littleendian(out + 60,x15);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x8(%rsp)
movl (%rcx), %ebx
movl (%rdx), %eax
movl %eax, -0x7c(%rsp)
movl 0x4(%rdx), %eax
movl %eax, -0x78(%rsp)
movl 0x8(%rdx), %eax
movl %eax, -0x74(%rsp)
movl 0xc(%rdx), %eax
movl %eax, -0x70(%rsp)
movl (%rsi), %eax
movl %eax, -0x6c(%rsp)
movl 0x4(%rsi), %r14d
movl 0x8(%rsi), %r11d
movl 0xc(%rsi), %r10d
movl 0x10(%rdx), %r8d
movl 0x14(%rdx), %edi
movl 0x18(%rdx), %esi
movl 0x1c(%rdx), %edx
movl 0x4(%rcx), %r12d
movl 0x8(%rcx), %r15d
movl 0xc(%rcx), %eax
movl $0xfffffff8, %ecx       # imm = 0xFFFFFFF8
movl %eax, (%rsp)
movq %rax, -0x68(%rsp)
movl %edx, -0x4(%rsp)
movl %edx, %eax
movq %rax, -0x48(%rsp)
movl %esi, -0x8(%rsp)
movl %esi, %r13d
movl %edi, -0xc(%rsp)
movl %edi, %ebp
movl %ecx, %edi
movl %r8d, -0x10(%rsp)
movl %r8d, %eax
movq %rax, -0x38(%rsp)
movl %r15d, -0x14(%rsp)
movl %r15d, %edx
movl %r10d, -0x18(%rsp)
movl %r10d, %r9d
movl %r11d, -0x1c(%rsp)
movl %r11d, %ecx
movl %r14d, -0x20(%rsp)
movl %r14d, %eax
movq %rax, -0x30(%rsp)
movl -0x6c(%rsp), %eax
movq %rax, -0x50(%rsp)
movl %r12d, -0x24(%rsp)
movl -0x70(%rsp), %eax
movl -0x74(%rsp), %esi
movq %rsi, -0x60(%rsp)
movl -0x78(%rsp), %esi
movq %rsi, -0x40(%rsp)
movl -0x7c(%rsp), %esi
movq %rsi, -0x58(%rsp)
movl %ebx, -0x28(%rsp)
movl %ebx, %r14d
testl %edi, %edi
je 0x37c9
movq %r14, %r10
leal (%r14,%rbp), %r15d
roll $0x7, %r15d
xorl %eax, %r15d
leal (%r15,%r14), %r8d
roll $0x9, %r8d
xorl %ecx, %r8d
movq %r8, 0x10(%rsp)
leal (%r8,%r15), %eax
roll $0xd, %eax
xorl %ebp, %eax
movq %rax, 0x20(%rsp)
addl %eax, %r8d
roll $0x12, %r8d
movq %r12, %r11
movq -0x58(%rsp), %rsi
addl %esi, %r12d
roll $0x7, %r12d
xorl %r9d, %r12d
leal (%r12,%r11), %ecx
roll $0x9, %ecx
xorl %r13d, %ecx
leal (%rcx,%r12), %eax
movq %rcx, 0x18(%rsp)
roll $0xd, %eax
xorl %esi, %eax
leal (%rax,%rcx), %ebp
roll $0x12, %ebp
xorl %r10d, %r8d
movq -0x50(%rsp), %r9
leal (%r9,%rdx), %r13d
roll $0x7, %r13d
xorl -0x48(%rsp), %r13d
leal (%rdx,%r13), %esi
roll $0x9, %esi
xorl -0x40(%rsp), %esi
movl %edi, 0x4(%rsp)
leal (%rsi,%r13), %edi
roll $0xd, %edi
xorl %r9d, %edi
leal (%rdi,%rsi), %r10d
roll $0x12, %r10d
xorl %r11d, %ebp
movq -0x38(%rsp), %r11
movq %rdx, %r14
movq -0x68(%rsp), %r9
leal (%r11,%r9), %edx
roll $0x7, %edx
movq -0x60(%rsp), %rcx
xorl %edx, %ecx
leal (%rcx,%r9), %ebx
roll $0x9, %ebx
xorl -0x30(%rsp), %ebx
leal (%rbx,%rcx), %edx
roll $0xd, %edx
xorl %r11d, %edx
leal (%rdx,%rbx), %r11d
roll $0x12, %r11d
xorl %r14d, %r10d
leal (%r8,%rcx), %r14d
roll $0x7, %r14d
xorl %eax, %r14d
leal (%r14,%r8), %eax
roll $0x9, %eax
xorl %esi, %eax
movq %r14, -0x58(%rsp)
leal (%rax,%r14), %esi
roll $0xd, %esi
xorl %ecx, %esi
movq %rax, -0x40(%rsp)
leal (%rsi,%rax), %r14d
roll $0x12, %r14d
xorl %r9d, %r11d
leal (%r15,%rbp), %eax
roll $0x7, %eax
xorl %edi, %eax
leal (%rax,%rbp), %edi
roll $0x9, %edi
xorl %ebx, %edi
movq %rax, -0x50(%rsp)
addl %edi, %eax
roll $0xd, %eax
xorl %r15d, %eax
movq %rdi, -0x30(%rsp)
leal (%rax,%rdi), %ebx
roll $0x12, %ebx
xorl %r8d, %r14d
leal (%r10,%r12), %edi
roll $0x7, %edi
xorl %edx, %edi
leal (%rdi,%r10), %ecx
roll $0x9, %ecx
xorl 0x10(%rsp), %ecx
movq %rdi, -0x38(%rsp)
leal (%rcx,%rdi), %edx
roll $0xd, %edx
xorl %r12d, %edx
movq %rdx, %r9
addl %ecx, %edx
roll $0x12, %edx
xorl %ebp, %ebx
movq %rbx, %r12
leal (%r11,%r13), %edi
roll $0x7, %edi
xorl 0x20(%rsp), %edi
leal (%rdi,%r11), %r8d
roll $0x9, %r8d
xorl 0x18(%rsp), %r8d
movq %rdi, %rbp
addl %r8d, %edi
roll $0xd, %edi
xorl %r13d, %edi
movq %rdi, -0x48(%rsp)
movq %r8, %r13
addl %edi, %r8d
movl 0x4(%rsp), %edi
roll $0x12, %r8d
xorl %r10d, %edx
xorl %r11d, %r8d
movq %r8, -0x68(%rsp)
addl $0x2, %edi
movq %rsi, -0x60(%rsp)
jmp 0x360f
addl -0x28(%rsp), %r14d
movq 0x8(%rsp), %rsi
movb %r14b, (%rsi)
movq %r14, %rbx
movb %bh, 0x1(%rsi)
movq %rdx, %rdi
movl %r14d, %edx
shrl $0x10, %edx
movb %dl, 0x2(%rsi)
movq %r14, %rdx
shrl $0x18, %edx
movb %dl, 0x3(%rsi)
movq -0x58(%rsp), %rbx
addl -0x7c(%rsp), %ebx
movb %bl, 0x4(%rsi)
movb %bh, 0x5(%rsi)
movl %ebx, %edx
shrl $0x10, %edx
movb %dl, 0x6(%rsi)
shrl $0x18, %ebx
movb %bl, 0x7(%rsi)
movq -0x40(%rsp), %rbx
addl -0x78(%rsp), %ebx
movb %bl, 0x8(%rsi)
movb %bh, 0x9(%rsi)
movl %ebx, %edx
shrl $0x10, %edx
movb %dl, 0xa(%rsi)
shrl $0x18, %ebx
movb %bl, 0xb(%rsi)
movq -0x60(%rsp), %rbx
addl -0x74(%rsp), %ebx
movb %bl, 0xc(%rsi)
movb %bh, 0xd(%rsi)
movl %ebx, %edx
shrl $0x10, %edx
movb %dl, 0xe(%rsi)
shrl $0x18, %ebx
movb %bl, 0xf(%rsi)
addl -0x70(%rsp), %eax
movb %al, 0x10(%rsi)
movb %ah, 0x11(%rsi)
movl %eax, %edx
shrl $0x10, %edx
movb %dl, 0x12(%rsi)
shrl $0x18, %eax
movb %al, 0x13(%rsi)
movq %r12, %rdx
addl -0x24(%rsp), %edx
movb %dl, 0x14(%rsi)
movb %dh, 0x15(%rsi)
movl %edx, %eax
shrl $0x10, %eax
movb %al, 0x16(%rsi)
shrl $0x18, %edx
movb %dl, 0x17(%rsi)
movq -0x50(%rsp), %rdx
addl -0x6c(%rsp), %edx
movb %dl, 0x18(%rsi)
movb %dh, 0x19(%rsi)
movl %edx, %eax
shrl $0x10, %eax
movb %al, 0x1a(%rsi)
shrl $0x18, %edx
movb %dl, 0x1b(%rsi)
movq -0x30(%rsp), %rdx
addl -0x20(%rsp), %edx
movb %dl, 0x1c(%rsi)
movb %dh, 0x1d(%rsi)
movl %edx, %eax
shrl $0x10, %eax
movb %al, 0x1e(%rsi)
shrl $0x18, %edx
movb %dl, 0x1f(%rsi)
addl -0x1c(%rsp), %ecx
movb %cl, 0x20(%rsi)
movb %ch, 0x21(%rsi)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x22(%rsi)
shrl $0x18, %ecx
movb %cl, 0x23(%rsi)
movq %r9, %rcx
addl -0x18(%rsp), %ecx
movb %cl, 0x24(%rsi)
movb %ch, 0x25(%rsi)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x26(%rsi)
shrl $0x18, %ecx
movb %cl, 0x27(%rsi)
movq %rdi, %rcx
addl -0x14(%rsp), %ecx
movb %cl, 0x28(%rsi)
movb %ch, 0x29(%rsi)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x2a(%rsi)
shrl $0x18, %ecx
movb %cl, 0x2b(%rsi)
movq -0x38(%rsp), %rcx
addl -0x10(%rsp), %ecx
movb %cl, 0x2c(%rsi)
movb %ch, 0x2d(%rsi)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x2e(%rsi)
shrl $0x18, %ecx
movb %cl, 0x2f(%rsi)
movq %rbp, %rcx
addl -0xc(%rsp), %ecx
movb %cl, 0x30(%rsi)
movb %ch, 0x31(%rsi)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x32(%rsi)
shrl $0x18, %ecx
movb %cl, 0x33(%rsi)
movq %r13, %rcx
addl -0x8(%rsp), %ecx
movb %cl, 0x34(%rsi)
movb %ch, 0x35(%rsi)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x36(%rsi)
shrl $0x18, %ecx
movb %cl, 0x37(%rsi)
movq -0x48(%rsp), %rcx
addl -0x4(%rsp), %ecx
movb %cl, 0x38(%rsi)
movb %ch, 0x39(%rsi)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x3a(%rsi)
shrl $0x18, %ecx
movb %cl, 0x3b(%rsi)
movq -0x68(%rsp), %rcx
addl (%rsp), %ecx
movb %cl, 0x3c(%rsi)
movb %ch, 0x3d(%rsi)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x3e(%rsi)
shrl $0x18, %ecx
movb %cl, 0x3f(%rsi)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop