// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/paeq128tnm/aesni/encrypt.cpp
// Function: GenerateNonceOpt(unsigned char*, unsigned char const*, unsigned long long, unsigned char const*, unsigned long long, unsigned char const*)
int GenerateNonceOpt(unsigned char* output, const unsigned char *m, unsigned long long mlen,
	const unsigned char *ad, unsigned long long adlen,
	const unsigned char *k)
	//Generate a nonce as a hash of the plaintext & AD by the AESQ-sponge function
{
	//Does not work for keys longer than 192 bits
	if (CRYPTO_KEYBYTES >24)
	{
		memset(output, 0, CRYPTO_NPUBBYTES);
		return -1;
	}

	__m128i State[4];  //sponge internal state
	__m128i StateOut[4];  //sponge internal state
	State[0] = State[1] = State[2] = State[3] = _mm_set_epi64x(0, 0);

	__m128i Injection[2]; //We inject into the first 32 bytes


	//Plaintext length -- 12 bytes and AD length - 12 bytes
	Injection[0] = _mm_set_epi64x(adlen << (CRYPTO_LENGTH*8-64), mlen);
	Injection[1] = _mm_set_epi64x(0, adlen >> (CRYPTO_LENGTH * 8 - 64));


	//Key and nonce length
	__m128i tmp = _mm_set_epi64x(CRYPTO_KEYBYTES + (CRYPTO_NPUBBYTES << 8), 0);
	Injection[1] = _mm_xor_si128(Injection[1], tmp);

	//Add key
	__m128i key = _mm_loadu_si128((__m128i*)k);
	Injection[1] = _mm_xor_si128(Injection[1], _mm_slli_si128(key, 2*CRYPTO_LENGTH+2-16)); //6 key bytes inserted

	//Iteration
	State[0] = _mm_xor_si128(State[0], Injection[0]);
	State[1] = _mm_xor_si128(State[1], Injection[1]);
	FPermAsm(State, StateOut);


	//Main loop
	unsigned state_index = 0;
	unsigned long long message_index = 0;
	unsigned long long ad_index = 0;
	unsigned char buf[32];

	//Remaining key bytes
	Injection[0] = _mm_srli_si128(key, CRYPTO_KEYBYTES - (2 * CRYPTO_LENGTH + 2 - 16));
	key = _mm_xor_si128(key, key);
	state_index = 2 * CRYPTO_LENGTH + 2 - 16;
	State[0] = _mm_xor_si128(StateOut[0], Injection[0]);
	State[1] = StateOut[1];
	State[2] = StateOut[2];
	State[3] = StateOut[3];

	//Injecting plaintext
	while (mlen >message_index) //we can load 32-byte chunks
	{
		if ((state_index == 0) && (mlen >= message_index + 32))
		{
			Injection[0] = _mm_loadu_si128((__m128i*)(m + message_index));
			Injection[1] = _mm_loadu_si128((__m128i*)(m + message_index+16));
			state_index = 32;
			message_index += 32;
		}
		else
		{
			memset(buf, 0, 32);
			if ((32 - state_index) <= (mlen - message_index))
			{
				memcpy(buf + state_index, m + message_index, 32 - state_index);
				message_index += 32-state_index;
				state_index = 32;

			}
			else
			{
				memcpy(buf + state_index, m + message_index, mlen - message_index);
				state_index += mlen - message_index;
				message_index = mlen;
			}
			Injection[0] = _mm_loadu_si128((__m128i*)buf);
			Injection[1] = _mm_loadu_si128((__m128i*)(buf + 16));
		}
		State[0] = _mm_xor_si128(State[0], Injection[0]);
		State[1] = _mm_xor_si128(State[1], Injection[1]);
		if (state_index == 32)
		{
			FPermAsm(State, StateOut);
			State[0] = StateOut[0];
			State[1] = StateOut[1];
			State[2] = StateOut[2];
			State[3] = StateOut[3];
			state_index = 0;
		}
	}//end of plaintext loading

	//Injecting AD
	while (adlen >ad_index) //we can load 32-byte chunks
	{
		if ((state_index == 0) && (adlen >= ad_index + 32))
		{
			Injection[0] = _mm_loadu_si128((__m128i*)(ad + ad_index));
			Injection[1] = _mm_loadu_si128((__m128i*)(ad + ad_index + 16));
			state_index = 32;
			ad_index += 32;
		}
		else
		{
			memset(buf, 0, 32);
			if ((32 - state_index) <= (adlen - ad_index))
			{
				memcpy(buf + state_index, ad + ad_index, 32 - state_index);
				ad_index += 32 - state_index;
				state_index = 32;
			}
			else
			{
				memcpy(buf + state_index, ad + ad_index, adlen - ad_index);
				state_index += adlen - ad_index;
				ad_index = adlen;
			}
			Injection[0] = _mm_loadu_si128((__m128i*)buf);
			Injection[1] = _mm_loadu_si128((__m128i*)(buf + 16));
		}
		State[0] = _mm_xor_si128(State[0], Injection[0]);
		State[1] = _mm_xor_si128(State[1], Injection[1]);
		if (state_index == 32)
		{
			FPermAsm(State, StateOut);

			State[0] = StateOut[0];
			State[1] = StateOut[1];
			State[2] = StateOut[2];
			State[3] = StateOut[3];
			state_index = 0;
		}
	}//end of AD loading

	//Injecting padding
	if (state_index < 31)
	{
		memset(buf, 0, 32);
		buf[state_index] = 1;
		buf[31] = 1;
		Injection[0] = _mm_loadu_si128((__m128i*)(buf ));
		Injection[1] = _mm_loadu_si128((__m128i*)(buf + 16)); 
		State[0] = _mm_xor_si128(State[0], Injection[0]);
		State[1] = _mm_xor_si128(State[1], Injection[1]);
		FPermAsm(State, StateOut);

		State[0] = StateOut[0];
		State[1] = StateOut[1];
		State[2] = StateOut[2];
		State[3] = StateOut[3];
	}
	else
	{
		Injection[1] = _mm_set_epi32(1 << 31, 0, 0, 0);
		State[1] = _mm_xor_si128(State[1], Injection[1]);
		FPermAsm(State, StateOut);

		State[0] = StateOut[0];
		State[1] = StateOut[1];
		State[2] = StateOut[2];
		State[3] = StateOut[3];
		State[1] = _mm_xor_si128(State[1], Injection[1]);
		FPermAsm(State, StateOut);

		State[0] = StateOut[0];
		State[1] = StateOut[1];
		State[2] = StateOut[2];
		State[3] = StateOut[3];
	}
	memcpy(output, StateOut, 32);
	return 0;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r8, %r14
movq %rcx, 0x38(%rsp)
movq %rdx, %r13
movq %rsi, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
movq %r8, %rax
shlq $0x20, %rax
vmovq %rdx, %xmm4
vmovq %rax, %xmm5
movq %r8, %rax
shrq $0x20, %rax
vmovd %eax, %xmm1
vmovupd (%r9), %xmm0
vpslldq $0xa, %xmm0, %xmm11     # xmm11 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5]
vpternlogq $0x96, 0x1255(%rip), %xmm1, %xmm11 # 0x41c0
vpbroadcastq 0x11a4(%rip), %xmm1 # 0x4118
vpbroadcastq 0x1193(%rip), %xmm2 # 0x4110
vpbroadcastq 0x119a(%rip), %xmm3 # 0x4120
vpunpcklqdq %xmm5, %xmm4, %xmm4 # xmm4 = xmm4[0],xmm5[0]
vpxor %xmm10, %xmm10, %xmm10
vpbroadcastq 0x1190(%rip), %xmm5 # 0x4128
xorl %eax, %eax
vpxor %xmm9, %xmm9, %xmm9
vmovdqa %xmm2, %xmm6
movl $0x1, %ecx
vaesenc %xmm5, %xmm4, %xmm4
vaesenc %xmm3, %xmm11, %xmm11
vaesenc %xmm1, %xmm9, %xmm9
vaesenc %xmm6, %xmm10, %xmm10
vpaddq %xmm2, %xmm5, %xmm5
vpaddq %xmm2, %xmm3, %xmm3
vpaddq %xmm2, %xmm1, %xmm1
vpaddq %xmm2, %xmm6, %xmm6
decl %ecx
je 0x2fa8
vpunpckhdq %xmm4, %xmm11, %xmm7 # xmm7 = xmm11[2],xmm4[2],xmm11[3],xmm4[3]
vpunpckldq %xmm4, %xmm11, %xmm4 # xmm4 = xmm11[0],xmm4[0],xmm11[1],xmm4[1]
vpunpckhdq %xmm9, %xmm10, %xmm8 # xmm8 = xmm10[2],xmm9[2],xmm10[3],xmm9[3]
vpunpckldq %xmm9, %xmm10, %xmm9 # xmm9 = xmm10[0],xmm9[0],xmm10[1],xmm9[1]
vpunpckhdq %xmm4, %xmm9, %xmm10 # xmm10 = xmm9[2],xmm4[2],xmm9[3],xmm4[3]
vpunpckldq %xmm4, %xmm9, %xmm4 # xmm4 = xmm9[0],xmm4[0],xmm9[1],xmm4[1]
vpunpckldq %xmm8, %xmm7, %xmm9 # xmm9 = xmm7[0],xmm8[0],xmm7[1],xmm8[1]
vpunpckhdq %xmm8, %xmm7, %xmm11 # xmm11 = xmm7[2],xmm8[2],xmm7[3],xmm8[3]
incl %eax
cmpl $0xa, %eax
jne 0x2fa3
vpsrldq $0x6, %xmm0, %xmm0      # xmm0 = xmm0[6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero
vpxor %xmm0, %xmm4, %xmm8
movl $0xa, %r15d
testq %r13, %r13
je 0x3177
xorl %ebx, %ebx
vpbroadcastq 0x10f2(%rip), %xmm12 # 0x4110
testl %r15d, %r15d
jne 0x3030
leaq 0x20(%rbx), %rcx
cmpq %r13, %rcx
jbe 0x315a
vmovdqa %xmm11, 0x40(%rsp)
vmovdqa %xmm8, 0x50(%rsp)
vmovdqa %xmm9, 0x60(%rsp)
vmovdqa %xmm10, 0x70(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovupd %ymm0, (%rsp)
movl $0x20, %ebp
subl %r15d, %ebp
movq %r13, %r12
subq %rbx, %r12
movq 0x30(%rsp), %rax
leaq (%rax,%rbx), %rsi
movl %r15d, %eax
leaq (%rsp,%rax), %rdi
cmpq %rbp, %r12
jae 0x3087
movq %r12, %rdx
vzeroupper
callq 0x10a0
addl %r12d, %r15d
movq %r13, %rbx
jmp 0x309b
movq %rbp, %rdx
vzeroupper
callq 0x10a0
addq %rbp, %rbx
movl $0x20, %r15d
vmovdqa 0x10(%rsp), %xmm0
movq %rsp, %rax
vmovdqa 0x70(%rsp), %xmm10
vmovdqa 0x60(%rsp), %xmm9
vmovdqa 0x50(%rsp), %xmm8
vmovdqa 0x40(%rsp), %xmm11
vpbroadcastq 0x104b(%rip), %xmm12 # 0x4110
vpxor %xmm0, %xmm11, %xmm11
vpxor (%rax), %xmm8, %xmm8
cmpl $0x20, %r15d
jne 0x314f
xorl %eax, %eax
vpbroadcastq 0x104a(%rip), %xmm0 # 0x4128
vpbroadcastq 0x1039(%rip), %xmm1 # 0x4120
vmovdqa %xmm12, %xmm2
vpbroadcastq 0x1024(%rip), %xmm3 # 0x4118
movl $0x1, %ecx
vaesenc %xmm0, %xmm8, %xmm8
vaesenc %xmm1, %xmm11, %xmm11
vaesenc %xmm3, %xmm9, %xmm9
vaesenc %xmm2, %xmm10, %xmm10
vpaddq %xmm0, %xmm12, %xmm0
vpaddq %xmm1, %xmm12, %xmm1
vpaddq %xmm3, %xmm12, %xmm3
vpaddq %xmm2, %xmm12, %xmm2
decl %ecx
je 0x30f9
vpunpckhdq %xmm8, %xmm11, %xmm4 # xmm4 = xmm11[2],xmm8[2],xmm11[3],xmm8[3]
vpunpckldq %xmm8, %xmm11, %xmm5 # xmm5 = xmm11[0],xmm8[0],xmm11[1],xmm8[1]
vpunpckhdq %xmm9, %xmm10, %xmm6 # xmm6 = xmm10[2],xmm9[2],xmm10[3],xmm9[3]
vpunpckldq %xmm9, %xmm10, %xmm7 # xmm7 = xmm10[0],xmm9[0],xmm10[1],xmm9[1]
vpunpckhdq %xmm5, %xmm7, %xmm10 # xmm10 = xmm7[2],xmm5[2],xmm7[3],xmm5[3]
vpunpckldq %xmm5, %xmm7, %xmm8 # xmm8 = xmm7[0],xmm5[0],xmm7[1],xmm5[1]
vpunpckldq %xmm6, %xmm4, %xmm9 # xmm9 = xmm4[0],xmm6[0],xmm4[1],xmm6[1]
vpunpckhdq %xmm6, %xmm4, %xmm11 # xmm11 = xmm4[2],xmm6[2],xmm4[3],xmm6[3]
incl %eax
cmpl $0xa, %eax
jne 0x30f4
xorl %r15d, %r15d
cmpq %r13, %rbx
jb 0x301e
jmp 0x3177
movq 0x30(%rsp), %rdx
leaq (%rdx,%rbx), %rax
vmovdqu 0x10(%rdx,%rbx), %xmm0
movl $0x20, %r15d
movq %rcx, %rbx
jmp 0x30c5
testq %r14, %r14
je 0x32e8
xorl %ebp, %ebp
movq %rsp, %r13
vpbroadcastq 0xf82(%rip), %xmm12 # 0x4110
testl %r15d, %r15d
jne 0x31a0
leaq 0x20(%rbp), %rcx
cmpq %r14, %rcx
jbe 0x32cb
vmovdqa %xmm11, 0x40(%rsp)
vmovdqa %xmm8, 0x50(%rsp)
vmovdqa %xmm9, 0x60(%rsp)
vmovdqa %xmm10, 0x70(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovupd %ymm0, (%rsp)
movl $0x20, %r12d
subl %r15d, %r12d
movq %r14, %rbx
subq %rbp, %rbx
movq 0x38(%rsp), %rax
leaq (%rax,%rbp), %rsi
movl %r15d, %eax
leaq (%rsp,%rax), %rdi
cmpq %r12, %rbx
jae 0x31f8
movq %rbx, %rdx
vzeroupper
callq 0x10a0
addl %ebx, %r15d
movq %r14, %rbp
jmp 0x320c
movq %r12, %rdx
vzeroupper
callq 0x10a0
addq %r12, %rbp
movl $0x20, %r15d
vmovdqa 0x10(%rsp), %xmm0
movq %r13, %rax
vmovdqa 0x70(%rsp), %xmm10
vmovdqa 0x60(%rsp), %xmm9
vmovdqa 0x50(%rsp), %xmm8
vmovdqa 0x40(%rsp), %xmm11
vpbroadcastq 0xeda(%rip), %xmm12 # 0x4110
vpxor %xmm0, %xmm11, %xmm11
vpxor (%rax), %xmm8, %xmm8
cmpl $0x20, %r15d
jne 0x32c0
xorl %eax, %eax
vpbroadcastq 0xed9(%rip), %xmm0 # 0x4128
vpbroadcastq 0xec8(%rip), %xmm1 # 0x4120
vmovdqa %xmm12, %xmm2
vpbroadcastq 0xeb3(%rip), %xmm3 # 0x4118
movl $0x1, %ecx
vaesenc %xmm0, %xmm8, %xmm8
vaesenc %xmm1, %xmm11, %xmm11
vaesenc %xmm3, %xmm9, %xmm9
vaesenc %xmm2, %xmm10, %xmm10
vpaddq %xmm0, %xmm12, %xmm0
vpaddq %xmm1, %xmm12, %xmm1
vpaddq %xmm3, %xmm12, %xmm3
vpaddq %xmm2, %xmm12, %xmm2
decl %ecx
je 0x326a
vpunpckhdq %xmm8, %xmm11, %xmm4 # xmm4 = xmm11[2],xmm8[2],xmm11[3],xmm8[3]
vpunpckldq %xmm8, %xmm11, %xmm5 # xmm5 = xmm11[0],xmm8[0],xmm11[1],xmm8[1]
vpunpckhdq %xmm9, %xmm10, %xmm6 # xmm6 = xmm10[2],xmm9[2],xmm10[3],xmm9[3]
vpunpckldq %xmm9, %xmm10, %xmm7 # xmm7 = xmm10[0],xmm9[0],xmm10[1],xmm9[1]
vpunpckhdq %xmm5, %xmm7, %xmm10 # xmm10 = xmm7[2],xmm5[2],xmm7[3],xmm5[3]
vpunpckldq %xmm5, %xmm7, %xmm8 # xmm8 = xmm7[0],xmm5[0],xmm7[1],xmm5[1]
vpunpckldq %xmm6, %xmm4, %xmm9 # xmm9 = xmm4[0],xmm6[0],xmm4[1],xmm6[1]
vpunpckhdq %xmm6, %xmm4, %xmm11 # xmm11 = xmm4[2],xmm6[2],xmm4[3],xmm6[3]
incl %eax
cmpl $0xa, %eax
jne 0x3265
xorl %r15d, %r15d
cmpq %r14, %rbp
jb 0x318e
jmp 0x32e8
movq 0x38(%rsp), %rdx
leaq (%rdx,%rbp), %rax
vmovdqu 0x10(%rdx,%rbp), %xmm0
movl $0x20, %r15d
movq %rcx, %rbp
jmp 0x3236
cmpl $0x1e, %r15d
ja 0x339e
vxorpd %xmm0, %xmm0, %xmm0
vmovupd %ymm0, (%rsp)
movl %r15d, %eax
movb $0x1, %cl
movb %cl, (%rsp,%rax)
movb %cl, 0x1f(%rsp)
vpxor (%rsp), %xmm8, %xmm8
vpxor 0x10(%rsp), %xmm11, %xmm0
vpbroadcastq 0xdfd(%rip), %xmm1 # 0x4118
vpbroadcastq 0xdec(%rip), %xmm2 # 0x4110
vpbroadcastq 0xdf3(%rip), %xmm3 # 0x4120
vpbroadcastq 0xdf2(%rip), %xmm4 # 0x4128
xorl %eax, %eax
vmovdqa %xmm2, %xmm5
movq 0x28(%rsp), %rdx
movl $0x1, %ecx
vaesenc %xmm4, %xmm8, %xmm8
vaesenc %xmm3, %xmm0, %xmm0
vaesenc %xmm1, %xmm9, %xmm9
vaesenc %xmm5, %xmm10, %xmm10
vpaddq %xmm2, %xmm4, %xmm4
vpaddq %xmm2, %xmm3, %xmm3
vpaddq %xmm2, %xmm1, %xmm1
vpaddq %xmm2, %xmm5, %xmm5
decl %ecx
je 0x3346
vpunpckhdq %xmm8, %xmm0, %xmm6 # xmm6 = xmm0[2],xmm8[2],xmm0[3],xmm8[3]
vpunpckldq %xmm8, %xmm0, %xmm0 # xmm0 = xmm0[0],xmm8[0],xmm0[1],xmm8[1]
vpunpckhdq %xmm9, %xmm10, %xmm7 # xmm7 = xmm10[2],xmm9[2],xmm10[3],xmm9[3]
vpunpckldq %xmm9, %xmm10, %xmm8 # xmm8 = xmm10[0],xmm9[0],xmm10[1],xmm9[1]
vpunpckhdq %xmm0, %xmm8, %xmm10 # xmm10 = xmm8[2],xmm0[2],xmm8[3],xmm0[3]
vpunpckldq %xmm0, %xmm8, %xmm8 # xmm8 = xmm8[0],xmm0[0],xmm8[1],xmm0[1]
vpunpckldq %xmm7, %xmm6, %xmm9 # xmm9 = xmm6[0],xmm7[0],xmm6[1],xmm7[1]
vpunpckhdq %xmm7, %xmm6, %xmm0 # xmm0 = xmm6[2],xmm7[2],xmm6[3],xmm7[3]
incl %eax
cmpl $0xa, %eax
jne 0x3341
jmp 0x34b7
vpxor 0xe2a(%rip), %xmm11, %xmm4 # 0x41d0
vpbroadcastq 0xd69(%rip), %xmm0 # 0x4118
vpbroadcastq 0xd58(%rip), %xmm1 # 0x4110
vpbroadcastq 0xd5f(%rip), %xmm2 # 0x4120
vpbroadcastq 0xd5e(%rip), %xmm3 # 0x4128
xorl %eax, %eax
vmovdqa %xmm1, %xmm5
movq 0x28(%rsp), %rdx
movl $0x1, %ecx
vaesenc %xmm3, %xmm8, %xmm8
vaesenc %xmm2, %xmm4, %xmm4
vaesenc %xmm0, %xmm9, %xmm9
vaesenc %xmm5, %xmm10, %xmm10
vpaddq %xmm1, %xmm3, %xmm3
vpaddq %xmm1, %xmm2, %xmm2
vpaddq %xmm1, %xmm0, %xmm0
vpaddq %xmm1, %xmm5, %xmm5
decl %ecx
je 0x33da
vpunpckhdq %xmm8, %xmm4, %xmm6 # xmm6 = xmm4[2],xmm8[2],xmm4[3],xmm8[3]
vpunpckldq %xmm8, %xmm4, %xmm4 # xmm4 = xmm4[0],xmm8[0],xmm4[1],xmm8[1]
vpunpckhdq %xmm9, %xmm10, %xmm7 # xmm7 = xmm10[2],xmm9[2],xmm10[3],xmm9[3]
vpunpckldq %xmm9, %xmm10, %xmm8 # xmm8 = xmm10[0],xmm9[0],xmm10[1],xmm9[1]
vpunpckhdq %xmm4, %xmm8, %xmm10 # xmm10 = xmm8[2],xmm4[2],xmm8[3],xmm4[3]
vpunpckldq %xmm4, %xmm8, %xmm8 # xmm8 = xmm8[0],xmm4[0],xmm8[1],xmm4[1]
vpunpckldq %xmm7, %xmm6, %xmm9 # xmm9 = xmm6[0],xmm7[0],xmm6[1],xmm7[1]
vpunpckhdq %xmm7, %xmm6, %xmm4 # xmm4 = xmm6[2],xmm7[2],xmm6[3],xmm7[3]
incl %eax
cmpl $0xa, %eax
jne 0x33d5
vpxor 0xd9b(%rip), %xmm4, %xmm0 # 0x41d0
vpbroadcastq 0xcda(%rip), %xmm1 # 0x4118
vpbroadcastq 0xcc9(%rip), %xmm2 # 0x4110
vpbroadcastq 0xcd0(%rip), %xmm3 # 0x4120
vpbroadcastq 0xccf(%rip), %xmm4 # 0x4128
xorl %eax, %eax
vmovdqa %xmm2, %xmm5
movl $0x1, %ecx
vaesenc %xmm4, %xmm8, %xmm8
vaesenc %xmm3, %xmm0, %xmm0
vaesenc %xmm1, %xmm9, %xmm9
vaesenc %xmm5, %xmm10, %xmm10
vpaddq %xmm2, %xmm4, %xmm4
vpaddq %xmm2, %xmm3, %xmm3
vpaddq %xmm2, %xmm1, %xmm1
vpaddq %xmm2, %xmm5, %xmm5
decl %ecx
je 0x3464
vpunpckhdq %xmm8, %xmm0, %xmm6 # xmm6 = xmm0[2],xmm8[2],xmm0[3],xmm8[3]
vpunpckldq %xmm8, %xmm0, %xmm0 # xmm0 = xmm0[0],xmm8[0],xmm0[1],xmm8[1]
vpunpckhdq %xmm9, %xmm10, %xmm7 # xmm7 = xmm10[2],xmm9[2],xmm10[3],xmm9[3]
vpunpckldq %xmm9, %xmm10, %xmm8 # xmm8 = xmm10[0],xmm9[0],xmm10[1],xmm9[1]
vpunpckhdq %xmm0, %xmm8, %xmm10 # xmm10 = xmm8[2],xmm0[2],xmm8[3],xmm0[3]
vpunpckldq %xmm0, %xmm8, %xmm8 # xmm8 = xmm8[0],xmm0[0],xmm8[1],xmm0[1]
vpunpckldq %xmm7, %xmm6, %xmm9 # xmm9 = xmm6[0],xmm7[0],xmm6[1],xmm7[1]
vpunpckhdq %xmm7, %xmm6, %xmm0 # xmm0 = xmm6[2],xmm7[2],xmm6[3],xmm7[3]
incl %eax
cmpl $0xa, %eax
jne 0x345f
vmovdqu %xmm8, (%rdx)
vmovdqu %xmm0, 0x10(%rdx)
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq