// File: /workspace/github_c_makefile_star2_O1/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: chacha20_rounds
static void chacha20_rounds(u32 out[16], const u32 in[16])
{
    // The temporary variables make Chacha20 10% faster.
    u32 t0  = in[ 0];  u32 t1  = in[ 1];  u32 t2  = in[ 2];  u32 t3  = in[ 3];
    u32 t4  = in[ 4];  u32 t5  = in[ 5];  u32 t6  = in[ 6];  u32 t7  = in[ 7];
    u32 t8  = in[ 8];  u32 t9  = in[ 9];  u32 t10 = in[10];  u32 t11 = in[11];
    u32 t12 = in[12];  u32 t13 = in[13];  u32 t14 = in[14];  u32 t15 = in[15];

    FOR (i, 0, 10) { // 20 rounds, 2 rounds per loop.
        QUARTERROUND(t0, t4, t8 , t12); // column 0
        QUARTERROUND(t1, t5, t9 , t13); // column 1
        QUARTERROUND(t2, t6, t10, t14); // column 2
        QUARTERROUND(t3, t7, t11, t15); // column 3
        QUARTERROUND(t0, t5, t10, t15); // diagonal 0
        QUARTERROUND(t1, t6, t11, t12); // diagonal 1
        QUARTERROUND(t2, t7, t8 , t13); // diagonal 2
        QUARTERROUND(t3, t4, t9 , t14); // diagonal 3
    }
    out[ 0] = t0;   out[ 1] = t1;   out[ 2] = t2;   out[ 3] = t3;
    out[ 4] = t4;   out[ 5] = t5;   out[ 6] = t6;   out[ 7] = t7;
    out[ 8] = t8;   out[ 9] = t9;   out[10] = t10;  out[11] = t11;
    out[12] = t12;  out[13] = t13;  out[14] = t14;  out[15] = t15;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, -0x10(%rsp)
movl (%rsi), %ecx
movl %ecx, -0x18(%rsp)
movl 0x4(%rsi), %ecx
movl %ecx, -0x1c(%rsp)
movl 0x8(%rsi), %ecx
movl %ecx, -0x20(%rsp)
movl 0xc(%rsi), %r13d
movl 0x10(%rsi), %r12d
movl 0x14(%rsi), %r15d
movl 0x18(%rsi), %r14d
movl 0x1c(%rsi), %ebp
movl 0x20(%rsi), %ebx
movl 0x24(%rsi), %r9d
movl 0x28(%rsi), %ecx
movl %ecx, -0x28(%rsp)
movl 0x2c(%rsi), %ecx
movl %ecx, -0x24(%rsp)
movl 0x30(%rsi), %r8d
movl 0x34(%rsi), %edx
movl 0x38(%rsi), %ecx
movl 0x3c(%rsi), %eax
movl $0xa, %esi
movq %rsi, -0x8(%rsp)
movl -0x18(%rsp), %esi
addl %r12d, %esi
xorl %esi, %r8d
roll $0x10, %r8d
addl %r8d, %ebx
xorl %ebx, %r12d
roll $0xc, %r12d
addl %r12d, %esi
xorl %esi, %r8d
roll $0x8, %r8d
addl %r8d, %ebx
xorl %ebx, %r12d
roll $0x7, %r12d
movl -0x1c(%rsp), %edi
addl %r15d, %edi
xorl %edi, %edx
roll $0x10, %edx
addl %edx, %r9d
xorl %r9d, %r15d
roll $0xc, %r15d
addl %r15d, %edi
xorl %edi, %edx
roll $0x8, %edx
addl %edx, %r9d
movl %r9d, -0x14(%rsp)
xorl %r9d, %r15d
roll $0x7, %r15d
movl -0x20(%rsp), %r9d
addl %r14d, %r9d
xorl %r9d, %ecx
roll $0x10, %ecx
movl -0x28(%rsp), %r11d
addl %ecx, %r11d
xorl %r11d, %r14d
roll $0xc, %r14d
addl %r14d, %r9d
xorl %r9d, %ecx
roll $0x8, %ecx
addl %ecx, %r11d
xorl %r11d, %r14d
roll $0x7, %r14d
addl %ebp, %r13d
xorl %r13d, %eax
roll $0x10, %eax
movl -0x24(%rsp), %r10d
addl %eax, %r10d
xorl %r10d, %ebp
roll $0xc, %ebp
addl %ebp, %r13d
xorl %r13d, %eax
roll $0x8, %eax
addl %eax, %r10d
xorl %r10d, %ebp
roll $0x7, %ebp
addl %r15d, %esi
xorl %esi, %eax
roll $0x10, %eax
addl %eax, %r11d
xorl %r11d, %r15d
roll $0xc, %r15d
addl %r15d, %esi
movl %esi, -0x18(%rsp)
xorl %esi, %eax
movq -0x8(%rsp), %rsi
roll $0x8, %eax
addl %eax, %r11d
movl %r11d, -0x28(%rsp)
xorl %r11d, %r15d
roll $0x7, %r15d
addl %r14d, %edi
xorl %edi, %r8d
roll $0x10, %r8d
addl %r8d, %r10d
xorl %r10d, %r14d
roll $0xc, %r14d
addl %r14d, %edi
movl %edi, -0x1c(%rsp)
xorl %edi, %r8d
roll $0x8, %r8d
addl %r8d, %r10d
movl %r10d, -0x24(%rsp)
xorl %r10d, %r14d
roll $0x7, %r14d
addl %ebp, %r9d
xorl %r9d, %edx
roll $0x10, %edx
addl %edx, %ebx
xorl %ebx, %ebp
roll $0xc, %ebp
addl %ebp, %r9d
movl %r9d, -0x20(%rsp)
xorl %r9d, %edx
movl -0x14(%rsp), %r9d
roll $0x8, %edx
addl %edx, %ebx
xorl %ebx, %ebp
roll $0x7, %ebp
addl %r12d, %r13d
xorl %r13d, %ecx
roll $0x10, %ecx
addl %ecx, %r9d
xorl %r9d, %r12d
roll $0xc, %r12d
addl %r12d, %r13d
xorl %r13d, %ecx
roll $0x8, %ecx
addl %ecx, %r9d
xorl %r9d, %r12d
roll $0x7, %r12d
decq %rsi
jne 0x1944
movq -0x10(%rsp), %rdi
movl -0x18(%rsp), %esi
movl %esi, (%rdi)
movl -0x1c(%rsp), %esi
movl %esi, 0x4(%rdi)
movl -0x20(%rsp), %esi
movl %esi, 0x8(%rdi)
movl %r13d, 0xc(%rdi)
movl %r12d, 0x10(%rdi)
movl %r15d, 0x14(%rdi)
movl %r14d, 0x18(%rdi)
movl %ebp, 0x1c(%rdi)
movl %ebx, 0x20(%rdi)
movl %r9d, 0x24(%rdi)
movl -0x28(%rsp), %esi
movl %esi, 0x28(%rdi)
movl -0x24(%rsp), %esi
movl %esi, 0x2c(%rdi)
movl %r8d, 0x30(%rdi)
movl %edx, 0x34(%rdi)
movl %ecx, 0x38(%rdi)
movl %eax, 0x3c(%rdi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq