// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/paeq128/aesni/encrypt.cpp
// Function: PAEQ128_opt_AESNI_decrypt(unsigned char*, unsigned long long*, unsigned char const*, unsigned long long, unsigned char const*, unsigned long long, unsigned char const*, unsigned char const*)
int PAEQ128_opt_AESNI_decrypt(unsigned char *m, unsigned long long *mlen,
	const unsigned char *c, unsigned long long clen,
	const unsigned char *ad, unsigned long long adlen,
	const unsigned char *npub,
	const unsigned char *k)
{

	if (mlen == NULL)
		return -1;
	if ((clen == 0) && (adlen == 0))
	{
		*mlen = 0;
		return 0;
	}

	(*mlen) = 0;
	//Minimum tag length verification
	if (clen < CRYPTO_ABYTES)
		return -1;

	//Here we do decryption and/or authentication so we need a key and a ciphertext pointer valid
	if ((k == NULL) || (c == NULL))
		return -2;

	//1.1 Initializing constants
	uint64_t D_left = ((uint64_t)CRYPTO_NPUBBYTES * 8) + (((uint64_t)CRYPTO_KEYBYTES * 8) << 8);
	__m128i D0 = _mm_set_epi64x(0, D_left);
	__m128i D2 = _mm_set_epi64x(0, D_left + 2);
	__m128i D3 = _mm_set_epi64x(0, D_left + 3);
	__m128i one128 = _mm_set_epi64x(0, 1);
	__m128i four128 = _mm_set_epi64x(0, 4);
	__m128i six128 = _mm_set_epi64x(0, 6);
	__m128i counter_one128 = _mm_set_epi64x(0, 1 << 16);  //value to increase the counter
	__m128i Dmask = _mm_set_epi32(0xffffffff, 0xffffffff, 0xffffffff, 0xffff0000);

	//Block variables
	__m128i BlockInput[4];  //V1 - input to the first layer call of F
	__m128i BlockMiddle[4];  //W1 - output of the first layer call of F
	__m128i BlockOutput[4];  //Y1 - output of the second layer call of F

	//Extra variables
	__m128i BlockExtraInput[4];
	__m128i BlockExtraMiddle[4];
	__m128i BlockExtraOutput[4];


	__m128i BlockLastInput[4];  //Z1 - input to the last call of F
	__m128i Tag[4]; //Tag output

	//1.2 Clearing variables
	memset(BlockLastInput, 0, 64);
	memset(BlockInput, 0, 64);
	memset(BlockOutput, 0, 64);
	memset(BlockMiddle, 0, 64);
	memset(BlockMiddle, 0, 64);

	//1.3 Setting first block
	BlockInput[0] = D0;  //Domain separation constant
	uint64_t nonce_low = (*((uint64_t*)npub)) << 32;
	uint64_t nonce_high = *((uint64_t*)(npub + 4));
	BlockInput[2] = _mm_set_epi64x(nonce_high, nonce_low);   //Nonce
	__m128i Key = _mm_set_epi64x(*((uint64_t*)(k + 8)), (*((uint64_t*)k)));
	BlockInput[3] = Key;


	unsigned long long decrypted_bytes = 0;//Encrypted bytes counter


	//Encryption part
	if (clen != 0)
	{
		if (c == NULL)
			return -3;

		while ((clen>CRYPTO_ABYTES))
		{
			/* I. First layer */

			if ((clen < (2 * CRYPTO_MBLOCK + CRYPTO_ABYTES)) || (decrypted_bytes == 0))
			{

				//1. Domain-separation constant
				if (clen < CRYPTO_MBLOCK + CRYPTO_ABYTES) //Last incomplete block
					BlockInput[0] = _mm_add_epi64(BlockInput[0], one128);

				//2. Counter incrementing
				BlockInput[0] = _mm_add_epi64(BlockInput[0], counter_one128);

				//3. Permutation call
				FPermAsm(BlockInput, BlockMiddle); //First layer call to F

				/* II. Encryption*/

				//1. Filling ciphertext buffers
				__m128i ciphertext128[3];
				__m128i plaintext_buffer[3];
				__m128i padding[3];
				__m128i boundary[3];
				memset(ciphertext128, 0, sizeof(__m128i) * 3);
				if (clen >= CRYPTO_MBLOCK + CRYPTO_ABYTES)//Full block encryption
				{
					ciphertext128[0] = D2;
					memcpy(((char*)ciphertext128) + 2, c + decrypted_bytes, CRYPTO_MBLOCK);
					memset(boundary, 0, sizeof(__m128i) * 3);
				}
				else
				{
					ciphertext128[0] = D3;
					memcpy(((char*)ciphertext128) + 2, c + decrypted_bytes, clen - CRYPTO_ABYTES);

					padding[0] = padding[1] = padding[2] = _mm_set1_epi8(clen - CRYPTO_ABYTES);
					boundary[0] = boundary[1] = boundary[2] = _mm_set1_epi8(0xff);
					memset(boundary, 0, clen - CRYPTO_ABYTES + 2);
				}


				//3. Getting plaintext
				plaintext_buffer[0] = _mm_xor_si128(BlockMiddle[0], ciphertext128[0]);
				plaintext_buffer[1] = _mm_xor_si128(BlockMiddle[1], ciphertext128[1]);
				plaintext_buffer[2] = _mm_xor_si128(BlockMiddle[2], ciphertext128[2]);

				if (clen >= CRYPTO_MBLOCK + CRYPTO_ABYTES)
					memcpy(m + decrypted_bytes, ((char*)plaintext_buffer) + 2, CRYPTO_MBLOCK);
				else //Last incomplete block
					memcpy(m + decrypted_bytes, ((char*)plaintext_buffer) + 2, (clen - CRYPTO_ABYTES));
				memset(plaintext_buffer, 0, 6 * sizeof(uint64_t));

				//4. Loading ciphertext
				BlockMiddle[0] = _mm_xor_si128(_mm_andnot_si128(boundary[0], ciphertext128[0]), _mm_and_si128(boundary[0], _mm_xor_si128(BlockMiddle[0], padding[0])));
				BlockMiddle[1] = _mm_xor_si128(_mm_andnot_si128(boundary[1], ciphertext128[1]), _mm_and_si128(boundary[1], _mm_xor_si128(BlockMiddle[1], padding[1])));
				BlockMiddle[2] = _mm_xor_si128(_mm_andnot_si128(boundary[2], ciphertext128[2]), _mm_and_si128(boundary[2], _mm_xor_si128(BlockMiddle[2], padding[2])));

				//III. Second permutation call
				//1. Call
				FPermAsm(BlockMiddle, BlockOutput); //Second layer call to F

				//2. Buffer update: Adding the output to tag preparation buffer
				BlockLastInput[0] = _mm_xor_si128(BlockOutput[0], BlockLastInput[0]);
				BlockLastInput[1] = _mm_xor_si128(BlockOutput[1], BlockLastInput[1]);
				BlockLastInput[2] = _mm_xor_si128(BlockOutput[2], BlockLastInput[2]);

				//Counters increment
				if (clen >= CRYPTO_MBLOCK + CRYPTO_ABYTES)
				{
					decrypted_bytes += CRYPTO_MBLOCK;
					clen -= CRYPTO_MBLOCK;
				}
				else
				{
					decrypted_bytes += (clen - CRYPTO_ABYTES);
					clen = CRYPTO_ABYTES;
				}
				(*mlen) = decrypted_bytes;
			}//end of <138 byte condition


			else //More than 137 bytes to encrypt
			{
				BlockExtraInput[0] = _mm_add_epi64(BlockInput[0], counter_one128);
				BlockInput[0] = _mm_add_epi64(BlockExtraInput[0], counter_one128);
				BlockExtraInput[1] = BlockInput[1];
				BlockExtraInput[2] = BlockInput[2];
				BlockExtraInput[3] = BlockInput[3];

				//2. Two-permutation call
				DoubleFPermAsm(BlockExtraInput, BlockInput, BlockExtraMiddle, BlockMiddle); //First layer call to F


				//3. Preparing plaintext buffer
				__m128i plaintext_buffer[6];  //96-byte storage
				plaintext_buffer[0] = BlockExtraMiddle[0];
				plaintext_buffer[1] = BlockExtraMiddle[1];
				plaintext_buffer[2] = BlockExtraMiddle[2];
				plaintext_buffer[3] = BlockMiddle[0];
				plaintext_buffer[4] = BlockMiddle[1];
				plaintext_buffer[5] = BlockMiddle[2];

				//4.Loading ciphertext
				BlockExtraMiddle[0] = _mm_loadu_si128((__m128i*)(c + decrypted_bytes - 2));   //Bytes [0:13]
				BlockExtraMiddle[1] = _mm_loadu_si128((__m128i*)(c + decrypted_bytes + 14));  //Bytes [14:29]
				BlockExtraMiddle[2] = _mm_loadu_si128((__m128i*)(c + decrypted_bytes + 30));  //Bytes [30:45]
				BlockMiddle[0] = _mm_loadu_si128((__m128i*)(c + decrypted_bytes + 44));  //Bytes [0:13]
				BlockMiddle[1] = _mm_loadu_si128((__m128i*)(c + decrypted_bytes + 60));   //Bytes [14:29]
				BlockMiddle[2] = _mm_loadu_si128((__m128i*)(c + decrypted_bytes + 76));  //Bytes [30:45]

				//5. Preparing the middle layer
				BlockMiddle[0] = _mm_and_si128(BlockMiddle[0], Dmask); //Clearing first two bytes
				BlockExtraMiddle[0] = _mm_and_si128(BlockExtraMiddle[0], Dmask);
				BlockMiddle[0] = _mm_xor_si128(BlockMiddle[0], D2);    //Loading D2
				BlockExtraMiddle[0] = _mm_xor_si128(BlockExtraMiddle[0], D2);

				//6. Getting plaintext
				plaintext_buffer[0] = _mm_xor_si128(plaintext_buffer[0], BlockExtraMiddle[0]);
				plaintext_buffer[1] = _mm_xor_si128(plaintext_buffer[1], BlockExtraMiddle[1]);
				plaintext_buffer[2] = _mm_xor_si128(plaintext_buffer[2], BlockExtraMiddle[2]);
				plaintext_buffer[3] = _mm_xor_si128(plaintext_buffer[3], BlockMiddle[0]);
				plaintext_buffer[4] = _mm_xor_si128(plaintext_buffer[4], BlockMiddle[1]);
				plaintext_buffer[5] = _mm_xor_si128(plaintext_buffer[5], BlockMiddle[2]);
				memcpy(m + decrypted_bytes, ((char*)plaintext_buffer) + 2, CRYPTO_MBLOCK);
				memcpy(m + decrypted_bytes + 46, ((char*)plaintext_buffer) + 50, CRYPTO_MBLOCK);

				//7. Second layer permutation
				DoubleFPermAsm(BlockExtraMiddle, BlockMiddle, BlockExtraOutput, BlockOutput); //Second layer call to F

				//8. Buffer update: Adding the output to tag preparation buffer
				BlockLastInput[0] = _mm_xor_si128(BlockOutput[0], BlockLastInput[0]);
				BlockLastInput[1] = _mm_xor_si128(BlockOutput[1], BlockLastInput[1]);
				BlockLastInput[2] = _mm_xor_si128(BlockOutput[2], BlockLastInput[2]);
				BlockLastInput[0] = _mm_xor_si128(BlockExtraOutput[0], BlockLastInput[0]);
				BlockLastInput[1] = _mm_xor_si128(BlockExtraOutput[1], BlockLastInput[1]);
				BlockLastInput[2] = _mm_xor_si128(BlockExtraOutput[2], BlockLastInput[2]);


				//9.Counter update
				decrypted_bytes += 2 * CRYPTO_MBLOCK;
				clen -= 2 * CRYPTO_MBLOCK;
				(*mlen) = decrypted_bytes;
			}


		}//end of encryption loop
	}//end of encryption part

	//Clearing variables
	for (unsigned i = 0; i < 4; ++i)
	{
		BlockInput[i] = _mm_xor_si128(BlockInput[i], BlockInput[i]);
		BlockMiddle[i] = _mm_xor_si128(BlockMiddle[i], BlockMiddle[i]);
		BlockOutput[i] = _mm_xor_si128(BlockOutput[i], BlockOutput[i]);

		BlockExtraInput[i] = _mm_xor_si128(BlockExtraInput[i], BlockExtraInput[i]);
		BlockExtraMiddle[i] = _mm_xor_si128(BlockExtraMiddle[i], BlockExtraMiddle[i]);
		BlockExtraOutput[i] = _mm_xor_si128(BlockExtraOutput[i], BlockExtraOutput[i]);
	}



	//Associated data part	  
	if (adlen != 0)
	{
		if (ad == NULL)
		{
			for (unsigned i = 0; i < 4; ++i)
				BlockLastInput[i] = _mm_xor_si128(BlockLastInput[i], BlockLastInput[i]);
			Key = _mm_xor_si128(Key, Key);
			return -4;
		}

		unsigned long long adblock_counter = 1;   //AD block counter
		unsigned long long auth_bytes = 0;

		//Preparing the block
		BlockInput[0] = _mm_add_epi64(D0, four128);
		BlockInput[3] = Key;
		while (adlen>0)
		{
			if ((adlen <= (2 * CRYPTO_ADBLOCK)) || (auth_bytes == 0))
			{

				//1. Constant
				if (adlen < CRYPTO_ADBLOCK)
					BlockInput[0] = _mm_add_epi64(BlockInput[0], one128);


				//2. Counter
				BlockInput[0] = _mm_add_epi64(BlockInput[0], counter_one128);

				//3. AD block

				//3.1 Filling AD buffers
				uint64_t ad_buffer[4];
				ad_buffer[0] = 0;
				if (adlen >= CRYPTO_ADBLOCK)//Full block encryption
					memcpy(((char*)ad_buffer) + 2, ad + auth_bytes, CRYPTO_ADBLOCK);
				else
				{
					//Filling buffers with adlen
					ad_buffer[0] = ((uint64_t)adlen * 0x01010000) ^ (((uint64_t)adlen * 0x01010101) << 32);
					for (unsigned i = 1; i < 4; ++i)
						ad_buffer[i] = (((uint64_t)adlen * 0x01010101) << 32) ^ ((uint64_t)adlen * 0x01010101);
					memcpy(((char*)ad_buffer) + 2, ad + auth_bytes, adlen);
				}

				//3.2 Working with BlockInput
				BlockInput[1] = _mm_set_epi64x(ad_buffer[1], ad_buffer[0]);
				BlockInput[2] = _mm_set_epi64x(ad_buffer[3], ad_buffer[2]);


				//4.Call to the F permutation
				FPermAsm(BlockInput, BlockOutput);//Call to the F permutation

				//Adding the output to tag preparation buffer
				BlockLastInput[0] = _mm_xor_si128(BlockOutput[0], BlockLastInput[0]);
				BlockLastInput[1] = _mm_xor_si128(BlockOutput[1], BlockLastInput[1]);
				BlockLastInput[2] = _mm_xor_si128(BlockOutput[2], BlockLastInput[2]);


				//Counters increment
				adblock_counter++;
				if (adlen >= CRYPTO_ADBLOCK)
				{
					auth_bytes += CRYPTO_ADBLOCK;
					adlen -= CRYPTO_ADBLOCK;
				}
				else
				{
					auth_bytes += adlen;
					adlen = 0;
				}
			}//end of 60-byte condition
			else //We authenticate 60-byte chunks
			{

				//1.Preparing input
				BlockExtraInput[0] = _mm_add_epi64(BlockInput[0], counter_one128);
				BlockInput[0] = _mm_add_epi64(BlockExtraInput[0], counter_one128);
				BlockExtraInput[3] = BlockInput[3]; //Key is constant

				//2. Loading AD
				BlockExtraInput[1] = _mm_loadu_si128((__m128i*)(ad + auth_bytes - 2));   //Bytes [0:13]
				BlockExtraInput[1] = _mm_and_si128(BlockExtraInput[1], Dmask); //Clearing first two bytes
				BlockExtraInput[2] = _mm_loadu_si128((__m128i*)(ad + auth_bytes + 14));  //Bytes [14:29]
				BlockInput[1] = _mm_loadu_si128((__m128i*)(ad + auth_bytes + 28));  //Bytes [0:13]
				BlockInput[1] = _mm_and_si128(BlockInput[1], Dmask); //Clearing first two bytes
				BlockInput[2] = _mm_loadu_si128((__m128i*)(ad + auth_bytes + 44));  //Bytes [14:29]

				//3. Call to the permutation
				DoubleFPermAsm(BlockExtraInput, BlockInput, BlockExtraOutput, BlockOutput);

				//4. Buffer update: Adding the output to tag preparation buffer
				BlockLastInput[0] = _mm_xor_si128(BlockOutput[0], BlockLastInput[0]);
				BlockLastInput[1] = _mm_xor_si128(BlockOutput[1], BlockLastInput[1]);
				BlockLastInput[2] = _mm_xor_si128(BlockOutput[2], BlockLastInput[2]);
				BlockLastInput[0] = _mm_xor_si128(BlockExtraOutput[0], BlockLastInput[0]);
				BlockLastInput[1] = _mm_xor_si128(BlockExtraOutput[1], BlockLastInput[1]);
				BlockLastInput[2] = _mm_xor_si128(BlockExtraOutput[2], BlockLastInput[2]);

				//5. Counter update
				auth_bytes += 2 * CRYPTO_ADBLOCK;
				adlen -= 2 * CRYPTO_ADBLOCK;
			}
		}//end of AD loop
	}//end of AD part

	// Tag production 
	BlockLastInput[3] = Key;
	BlockLastInput[0] = _mm_and_si128(BlockLastInput[0], Dmask); //Clearing first two bytes
	BlockLastInput[0] = _mm_add_epi64(BlockLastInput[0], six128);
	BlockLastInput[0] = _mm_add_epi64(BlockLastInput[0], D0);

	//1. Permutation call
	FPermAsm(BlockLastInput, Tag);
	//2. Key injection
	Tag[3] = _mm_xor_si128(Tag[3], Key);

	//3. Clearing variables
	for (unsigned i = 0; i < 4; ++i)
	{
		BlockInput[i] = _mm_xor_si128(BlockInput[i], BlockInput[i]);
		BlockMiddle[i] = _mm_xor_si128(BlockMiddle[i], BlockMiddle[i]);
		BlockOutput[i] = _mm_xor_si128(BlockOutput[i], BlockOutput[i]);

		BlockExtraInput[i] = _mm_xor_si128(BlockExtraInput[i], BlockExtraInput[i]);
		BlockExtraMiddle[i] = _mm_xor_si128(BlockExtraMiddle[i], BlockExtraMiddle[i]);
		BlockExtraOutput[i] = _mm_xor_si128(BlockExtraOutput[i], BlockExtraOutput[i]);
		BlockLastInput[i] = _mm_xor_si128(BlockLastInput[i], BlockLastInput[i]);
	}
	Key = _mm_xor_si128(Key, Key);

	//4. Checking tag
	__m128i ciphertext_tag = _mm_loadu_si128((__m128i*)(c + (*mlen)));
	ciphertext_tag = _mm_xor_si128(ciphertext_tag, Tag[0]);
	uint32_t* test = (uint32_t*)(&ciphertext_tag);
	
	if ((test[0] == 0) && (test[1] == 0) && (test[2] == 0) && (test[3] == 0))
		return 0;
	else return -1;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0x220a
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %r9, %r14
movq %rcx, %r12
movq %rsi, %r13
movq %r9, %rcx
orq %r12, %rcx
movq $0x0, (%rsi)
je 0x16c4
cmpq $0x10, %r12
jb 0x21f9
movq 0x1c8(%rsp), %rcx
testq %rcx, %rcx
sete %al
testq %rdx, %rdx
sete %sil
orb %al, %sil
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jne 0x21f9
vmovdqu (%rcx), %xmm14
cmpq $0x10, %r12
movq %rdx, 0x8(%rsp)
vmovdqa %xmm14, 0x80(%rsp)
movq %r8, (%rsp)
jne 0x16cb
vpxor %xmm15, %xmm15, %xmm15
xorl %r15d, %r15d
vpxor %xmm10, %xmm10, %xmm10
vpxor %xmm11, %xmm11, %xmm11
jmp 0x1dd1
xorl %eax, %eax
jmp 0x21f9
movq %rdi, %rbp
movq 0x1c0(%rsp), %rax
movq (%rax), %rcx
shlq $0x20, %rcx
vmovq 0x4(%rax), %xmm0
vmovq %rcx, %xmm1
vpunpcklqdq %xmm0, %xmm1, %xmm18 # xmm18 = xmm1[0],xmm0[0]
leaq 0x12(%rsp), %rdi
leaq 0x112(%rsp), %r9
vmovd 0x1acc(%rip), %xmm19    # 0x31d0
vmovd 0x1ac6(%rip), %xmm20    # 0x31d4
vpbroadcastq 0x1a00(%rip), %xmm21 # 0x3118
vpbroadcastq 0x19ee(%rip), %xmm22 # 0x3110
xorl %ebx, %ebx
vpbroadcastq 0x19f2(%rip), %xmm23 # 0x3120
vpbroadcastq 0x19f0(%rip), %xmm24 # 0x3128
vxorps %xmm25, %xmm25, %xmm25
vpxor %xmm15, %xmm15, %xmm15
vpxor %xmm10, %xmm10, %xmm10
vpxor %xmm11, %xmm11, %xmm11
vmovdqa64 %xmm18, 0x90(%rsp)
cmpq $0x6c, %r12
jb 0x19f2
testq %rbx, %rbx
je 0x19f2
vmovdqa64 %xmm11, %xmm17
vmovdqa64 %xmm10, %xmm16
vpaddq %xmm20, %xmm19, %xmm10
vpaddq 0x19dc(%rip), %xmm19, %xmm19 # 0x3160
vpxor %xmm9, %xmm9, %xmm9
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm2
vmovdqa64 %xmm23, %xmm3
vmovdqa %xmm14, %xmm0
vmovdqa64 %xmm18, %xmm8
vmovdqa64 %xmm19, %xmm11
vmovdqa %xmm14, %xmm1
vmovdqa64 %xmm18, %xmm12
vpxor %xmm13, %xmm13, %xmm13
vmovdqa64 %xmm21, %xmm4
vmovdqa64 %xmm22, %xmm5
movb $0x1, %cl
vaesenc %xmm2, %xmm10, %xmm10
vaesenc %xmm3, %xmm13, %xmm13
vaesenc %xmm4, %xmm12, %xmm12
vaesenc %xmm5, %xmm1, %xmm1
vaesenc %xmm2, %xmm11, %xmm11
vaesenc %xmm3, %xmm9, %xmm9
vaesenc %xmm4, %xmm8, %xmm8
vaesenc %xmm5, %xmm0, %xmm0
vpaddq %xmm22, %xmm2, %xmm2
vpaddq %xmm22, %xmm3, %xmm3
vpaddq %xmm22, %xmm4, %xmm4
vpaddq %xmm22, %xmm5, %xmm5
testb $0x1, %cl
movl $0x0, %ecx
jne 0x17c4
vpunpckhdq %xmm10, %xmm13, %xmm6 # xmm6 = xmm13[2],xmm10[2],xmm13[3],xmm10[3]
vpunpckldq %xmm10, %xmm13, %xmm7 # xmm7 = xmm13[0],xmm10[0],xmm13[1],xmm10[1]
vpunpckhdq %xmm12, %xmm1, %xmm13 # xmm13 = xmm1[2],xmm12[2],xmm1[3],xmm12[3]
vpunpckldq %xmm12, %xmm1, %xmm10 # xmm10 = xmm1[0],xmm12[0],xmm1[1],xmm12[1]
vpunpckhdq %xmm7, %xmm10, %xmm1 # xmm1 = xmm10[2],xmm7[2],xmm10[3],xmm7[3]
vpunpckldq %xmm7, %xmm10, %xmm10 # xmm10 = xmm10[0],xmm7[0],xmm10[1],xmm7[1]
vpunpckldq %xmm13, %xmm6, %xmm12 # xmm12 = xmm6[0],xmm13[0],xmm6[1],xmm13[1]
vpunpckhdq %xmm13, %xmm6, %xmm13 # xmm13 = xmm6[2],xmm13[2],xmm6[3],xmm13[3]
vpunpckhdq %xmm11, %xmm9, %xmm6 # xmm6 = xmm9[2],xmm11[2],xmm9[3],xmm11[3]
vpunpckldq %xmm11, %xmm9, %xmm7 # xmm7 = xmm9[0],xmm11[0],xmm9[1],xmm11[1]
vpunpckhdq %xmm8, %xmm0, %xmm9 # xmm9 = xmm0[2],xmm8[2],xmm0[3],xmm8[3]
vpunpckldq %xmm8, %xmm0, %xmm8 # xmm8 = xmm0[0],xmm8[0],xmm0[1],xmm8[1]
vpunpckhdq %xmm7, %xmm8, %xmm0 # xmm0 = xmm8[2],xmm7[2],xmm8[3],xmm7[3]
vpunpckldq %xmm7, %xmm8, %xmm11 # xmm11 = xmm8[0],xmm7[0],xmm8[1],xmm7[1]
vpunpckldq %xmm9, %xmm6, %xmm8 # xmm8 = xmm6[0],xmm9[0],xmm6[1],xmm9[1]
vpunpckhdq %xmm9, %xmm6, %xmm9 # xmm9 = xmm6[2],xmm9[2],xmm6[3],xmm9[3]
incl %eax
cmpl $0xa, %eax
jne 0x17c2
vmovdqu 0xe(%rdx,%rbx), %xmm4
vmovdqu 0x1e(%rdx,%rbx), %xmm2
vmovdqu 0x3c(%rdx,%rbx), %xmm5
vmovdqu 0x4c(%rdx,%rbx), %xmm3
vpxor %xmm7, %xmm7, %xmm7
vpblendw $0xfe, 0x2c(%rdx,%rbx), %xmm7, %xmm6 # xmm6 = xmm7[0],mem[1,2,3,4,5,6,7]
vpblendw $0xfe, -0x2(%rdx,%rbx), %xmm7, %xmm7 # xmm7 = xmm7[0],mem[1,2,3,4,5,6,7]
vmovd 0x193d(%rip), %xmm26    # 0x31d8
vpxorq %xmm26, %xmm6, %xmm6
vpxorq %xmm26, %xmm7, %xmm7
vpxor %xmm7, %xmm10, %xmm10
vmovdqa %xmm10, 0x10(%rsp)
vpxor %xmm4, %xmm13, %xmm10
vpxor %xmm2, %xmm12, %xmm12
vpxor %xmm6, %xmm11, %xmm11
vmovdqa %xmm11, 0x110(%rsp)
vpxor %xmm5, %xmm9, %xmm9
movq (%rdi), %rax
movq 0x6(%rdi), %rcx
movq %rcx, 0x6(%rbp,%rbx)
movq %rax, (%rbp,%rbx)
vmovdqu %xmm10, 0xe(%rbp,%rbx)
vpxor %xmm3, %xmm8, %xmm8
vmovdqu %xmm12, 0x1e(%rbp,%rbx)
movq (%r9), %rax
movq 0x6(%r9), %rcx
movq %rax, 0x2e(%rbp,%rbx)
movq %rcx, 0x34(%rbp,%rbx)
vmovdqu %xmm9, 0x3c(%rbp,%rbx)
vmovdqu %xmm8, 0x4c(%rbp,%rbx)
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm8
vmovdqa64 %xmm23, %xmm9
vmovdqa64 %xmm21, %xmm10
vmovdqa64 %xmm22, %xmm11
movb $0x1, %cl
vaesenc %xmm8, %xmm7, %xmm7
vaesenc %xmm9, %xmm4, %xmm4
vaesenc %xmm10, %xmm2, %xmm2
vaesenc %xmm11, %xmm1, %xmm1
vaesenc %xmm8, %xmm6, %xmm6
vaesenc %xmm9, %xmm5, %xmm5
vaesenc %xmm10, %xmm3, %xmm3
vaesenc %xmm11, %xmm0, %xmm0
vpaddq %xmm22, %xmm8, %xmm8
vpaddq %xmm22, %xmm9, %xmm9
vpaddq %xmm22, %xmm10, %xmm10
vpaddq %xmm22, %xmm11, %xmm11
testb $0x1, %cl
movl $0x0, %ecx
jne 0x1924
vpunpckhdq %xmm7, %xmm4, %xmm12 # xmm12 = xmm4[2],xmm7[2],xmm4[3],xmm7[3]
vpunpckldq %xmm7, %xmm4, %xmm4 # xmm4 = xmm4[0],xmm7[0],xmm4[1],xmm7[1]
vpunpckhdq %xmm2, %xmm1, %xmm13 # xmm13 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
vpunpckldq %xmm2, %xmm1, %xmm2 # xmm2 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
vpunpckhdq %xmm4, %xmm2, %xmm1 # xmm1 = xmm2[2],xmm4[2],xmm2[3],xmm4[3]
vpunpckldq %xmm4, %xmm2, %xmm7 # xmm7 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
vpunpckldq %xmm13, %xmm12, %xmm2 # xmm2 = xmm12[0],xmm13[0],xmm12[1],xmm13[1]
vpunpckhdq %xmm13, %xmm12, %xmm4 # xmm4 = xmm12[2],xmm13[2],xmm12[3],xmm13[3]
vpunpckhdq %xmm6, %xmm5, %xmm12 # xmm12 = xmm5[2],xmm6[2],xmm5[3],xmm6[3]
vpunpckldq %xmm6, %xmm5, %xmm5 # xmm5 = xmm5[0],xmm6[0],xmm5[1],xmm6[1]
vpunpckhdq %xmm3, %xmm0, %xmm13 # xmm13 = xmm0[2],xmm3[2],xmm0[3],xmm3[3]
vpunpckldq %xmm3, %xmm0, %xmm3 # xmm3 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
vpunpckhdq %xmm5, %xmm3, %xmm0 # xmm0 = xmm3[2],xmm5[2],xmm3[3],xmm5[3]
vpunpckldq %xmm5, %xmm3, %xmm6 # xmm6 = xmm3[0],xmm5[0],xmm3[1],xmm5[1]
vpunpckldq %xmm13, %xmm12, %xmm3 # xmm3 = xmm12[0],xmm13[0],xmm12[1],xmm13[1]
vpunpckhdq %xmm13, %xmm12, %xmm5 # xmm5 = xmm12[2],xmm13[2],xmm12[3],xmm13[3]
incl %eax
cmpl $0xa, %eax
jne 0x1922
vmovdqa64 %xmm17, %xmm11
vpternlogq $0x96, %xmm6, %xmm7, %xmm11
vmovdqa64 %xmm16, %xmm10
vpternlogq $0x96, %xmm5, %xmm4, %xmm10
vpternlogq $0x96, %xmm3, %xmm2, %xmm15
addq $0x5c, %rbx
addq $-0x5c, %r12
movq %rbx, (%r13)
movq %rbx, %r15
jmp 0x1dc7
cmpq $0x3e, %r12
jae 0x1a02
vpaddq 0x177e(%rip), %xmm19, %xmm19 # 0x3180
vpaddq %xmm20, %xmm19, %xmm19
vpxor %xmm5, %xmm5, %xmm5
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm0
vmovdqa64 %xmm18, %xmm7
vmovdqa64 %xmm19, %xmm9
vmovdqa64 %xmm23, %xmm1
vmovdqa64 %xmm22, %xmm2
vmovdqa64 %xmm21, %xmm3
movb $0x1, %cl
vaesenc %xmm0, %xmm9, %xmm9
vaesenc %xmm1, %xmm5, %xmm5
vaesenc %xmm3, %xmm7, %xmm7
vaesenc %xmm2, %xmm14, %xmm14
vpaddq %xmm22, %xmm0, %xmm0
vpaddq %xmm22, %xmm1, %xmm1
vpaddq %xmm22, %xmm3, %xmm3
vpaddq %xmm22, %xmm2, %xmm2
testb $0x1, %cl
movl $0x0, %ecx
jne 0x1a34
vpunpckhdq %xmm9, %xmm5, %xmm4 # xmm4 = xmm5[2],xmm9[2],xmm5[3],xmm9[3]
vpunpckldq %xmm9, %xmm5, %xmm5 # xmm5 = xmm5[0],xmm9[0],xmm5[1],xmm9[1]
vpunpckhdq %xmm7, %xmm14, %xmm6 # xmm6 = xmm14[2],xmm7[2],xmm14[3],xmm7[3]
vpunpckldq %xmm7, %xmm14, %xmm7 # xmm7 = xmm14[0],xmm7[0],xmm14[1],xmm7[1]
vpunpckhdq %xmm5, %xmm7, %xmm14 # xmm14 = xmm7[2],xmm5[2],xmm7[3],xmm5[3]
vpunpckldq %xmm5, %xmm7, %xmm9 # xmm9 = xmm7[0],xmm5[0],xmm7[1],xmm5[1]
vpunpckldq %xmm6, %xmm4, %xmm7 # xmm7 = xmm4[0],xmm6[0],xmm4[1],xmm6[1]
vpunpckhdq %xmm6, %xmm4, %xmm5 # xmm5 = xmm4[2],xmm6[2],xmm4[3],xmm6[3]
incl %eax
cmpl $0xa, %eax
jne 0x1a32
vmovups %ymm25, 0x10(%rsp)
vmovups %ymm25, 0x20(%rsp)
leaq (%rdx,%rbx), %rsi
cmpq $0x3e, %r12
vmovdqa %xmm15, 0x70(%rsp)
vmovdqa %xmm10, 0x60(%rsp)
vmovdqa %xmm11, 0x50(%rsp)
vmovdqa64 %xmm19, 0x40(%rsp)
vmovdqa %xmm14, 0xd0(%rsp)
vmovdqa %xmm7, 0xc0(%rsp)
vmovdqa %xmm5, 0xb0(%rsp)
vmovdqa %xmm9, 0xa0(%rsp)
jb 0x1b26
vmovss 0x16e2(%rip), %xmm0     # 0x31d8
vmovaps %xmm0, 0x10(%rsp)
vmovdqu (%rsi), %ymm0
vmovdqu 0xe(%rsi), %ymm1
vmovdqu %ymm1, 0xe(%rdi)
vmovdqu %ymm0, (%rdi)
vmovups %ymm25, 0xf0(%rsp)
vmovups %ymm25, 0xe0(%rsp)
jmp 0x1ba9
vmovss 0x16ae(%rip), %xmm0     # 0x31dc
vmovaps %xmm0, 0x10(%rsp)
leaq -0x10(%r12), %r15
movq %r15, %rdx
vzeroupper
callq 0x1090
vpbroadcastb %r15d, %xmm0
vmovdqa %xmm0, 0x170(%rsp)
leaq -0xe(%r12), %rdx
vpcmpeqd %ymm0, %ymm0, %ymm0
vmovdqu %ymm0, 0xe0(%rsp)
vmovdqu %ymm0, 0xf0(%rsp)
leaq 0xe0(%rsp), %rdi
xorl %esi, %esi
vzeroupper
callq 0x1030
vmovdqa 0xa0(%rsp), %xmm9
vmovdqa 0xb0(%rsp), %xmm5
vmovdqa 0xc0(%rsp), %xmm7
vxorps %xmm25, %xmm25, %xmm25
leaq 0x112(%rsp), %r9
leaq (%rbx,%rbp), %rdi
vmovdqa 0x10(%rsp), %xmm13
vmovdqa 0x20(%rsp), %xmm6
vmovdqa 0x30(%rsp), %xmm12
vpxor %xmm9, %xmm13, %xmm0
vmovdqa %xmm0, 0x110(%rsp)
vpxor %xmm5, %xmm6, %xmm0
vmovdqa %xmm0, 0x120(%rsp)
vpxor %xmm7, %xmm12, %xmm0
vmovdqa %xmm0, 0x130(%rsp)
cmpq $0x3e, %r12
jb 0x1c03
vmovdqu (%r9), %ymm0
vmovdqu 0xe(%r9), %ymm1
vmovdqu %ymm1, 0xe(%rdi)
vmovdqu %ymm0, (%rdi)
jmp 0x1c72
leaq -0x10(%r12), %rdx
movq %r9, %rsi
vmovdqa %xmm12, 0x160(%rsp)
vmovdqa %xmm13, 0x150(%rsp)
vmovdqa %xmm6, 0x140(%rsp)
vzeroupper
callq 0x1090
vmovdqa 0x140(%rsp), %xmm6
vmovdqa 0x150(%rsp), %xmm13
vmovdqa 0x160(%rsp), %xmm12
vmovdqa 0xa0(%rsp), %xmm9
vmovdqa 0xb0(%rsp), %xmm5
vmovdqa 0xc0(%rsp), %xmm7
vxorps %xmm25, %xmm25, %xmm25
leaq 0x112(%rsp), %r9
movq 0x8(%rsp), %rdx
vmovdqa 0x80(%rsp), %xmm14
vmovdqa 0x70(%rsp), %xmm15
vmovdqa 0x60(%rsp), %xmm10
movq (%rsp), %r8
vmovdqa 0x50(%rsp), %xmm11
vmovdqa64 0x90(%rsp), %xmm18
vmovdqa64 0x40(%rsp), %xmm19
vmovd 0x1524(%rip), %xmm20    # 0x31d4
vpbroadcastq 0x145e(%rip), %xmm21 # 0x3118
vpbroadcastq 0x144c(%rip), %xmm22 # 0x3110
vpbroadcastq 0x1452(%rip), %xmm23 # 0x3120
vpbroadcastq 0x1450(%rip), %xmm24 # 0x3128
vmovdqa 0xd0(%rsp), %xmm8
vmovdqa 0x170(%rsp), %xmm1
vpxor %xmm1, %xmm9, %xmm0
vpternlogq $0xd8, 0xe0(%rsp), %xmm0, %xmm13
vpxor %xmm5, %xmm1, %xmm0
vpternlogq $0xd8, 0xf0(%rsp), %xmm0, %xmm6
vpxor %xmm7, %xmm1, %xmm0
vpternlogq $0xd8, 0x100(%rsp), %xmm0, %xmm12
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm0
vmovdqa64 %xmm23, %xmm1
vmovdqa64 %xmm22, %xmm2
vmovdqa64 %xmm21, %xmm3
leaq 0x12(%rsp), %rdi
movb $0x1, %cl
vaesenc %xmm0, %xmm13, %xmm13
vaesenc %xmm1, %xmm6, %xmm6
vaesenc %xmm3, %xmm12, %xmm12
vaesenc %xmm2, %xmm8, %xmm8
vpaddq %xmm22, %xmm0, %xmm0
vpaddq %xmm22, %xmm1, %xmm1
vpaddq %xmm22, %xmm3, %xmm3
vpaddq %xmm22, %xmm2, %xmm2
testb $0x1, %cl
movl $0x0, %ecx
jne 0x1d32
vpunpckhdq %xmm13, %xmm6, %xmm4 # xmm4 = xmm6[2],xmm13[2],xmm6[3],xmm13[3]
vpunpckldq %xmm13, %xmm6, %xmm5 # xmm5 = xmm6[0],xmm13[0],xmm6[1],xmm13[1]
vpunpckhdq %xmm12, %xmm8, %xmm6 # xmm6 = xmm8[2],xmm12[2],xmm8[3],xmm12[3]
vpunpckldq %xmm12, %xmm8, %xmm7 # xmm7 = xmm8[0],xmm12[0],xmm8[1],xmm12[1]
vpunpckhdq %xmm5, %xmm7, %xmm8 # xmm8 = xmm7[2],xmm5[2],xmm7[3],xmm5[3]
vpunpckldq %xmm5, %xmm7, %xmm13 # xmm13 = xmm7[0],xmm5[0],xmm7[1],xmm5[1]
vpunpckldq %xmm6, %xmm4, %xmm12 # xmm12 = xmm4[0],xmm6[0],xmm4[1],xmm6[1]
vpunpckhdq %xmm6, %xmm4, %xmm6 # xmm6 = xmm4[2],xmm6[2],xmm4[3],xmm6[3]
incl %eax
cmpl $0xa, %eax
jne 0x1d30
leaq -0x10(%r12), %r15
cmpq $0x3e, %r12
movl $0x2e, %eax
cmovaeq %rax, %r15
addq %rbx, %r15
vpxor %xmm13, %xmm11, %xmm11
vpxor %xmm6, %xmm10, %xmm10
vpxor %xmm12, %xmm15, %xmm15
movq %r15, (%r13)
cmpq $0x3d, %r12
jbe 0x1dd1
addq $-0x2e, %r12
movq %r15, %rbx
cmpq $0x10, %r12
ja 0x1755
testq %r14, %r14
je 0x214b
testq %r8, %r8
je 0x21f4
movabsq $0x101010101010000, %rbx # imm = 0x101010101010000
leaq 0x12(%rsp), %r12
vmovd 0x13e4(%rip), %xmm18    # 0x31e0
vmovd 0x13ce(%rip), %xmm19    # 0x31d4
vpbroadcastq 0x1308(%rip), %xmm20 # 0x3118
vpbroadcastq 0x12f6(%rip), %xmm21 # 0x3110
xorl %r13d, %r13d
vpbroadcastq 0x12f9(%rip), %xmm22 # 0x3120
vpbroadcastq 0x12f7(%rip), %xmm23 # 0x3128
leaq 0x101(%rbx), %rbp
vmovd 0x13a2(%rip), %xmm24    # 0x31e4
cmpq $0x3d, %r14
setb %al
testq %r13, %r13
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x1e8e
cmpq $0x1e, %r14
jb 0x1fbb
vpaddq %xmm19, %xmm18, %xmm18
movq $0x0, 0x10(%rsp)
vmovdqu (%r8,%r13), %xmm0
vmovdqu 0xe(%r8,%r13), %xmm1
vmovdqu %xmm1, 0xe(%r12)
vmovdqu %xmm0, (%r12)
jmp 0x2083
vmovdqa64 %xmm11, %xmm17
vmovdqa64 %xmm10, %xmm16
vpaddq %xmm19, %xmm18, %xmm1
vpxor %xmm4, %xmm4, %xmm4
vpblendw $0xfe, -0x2(%r8,%r13), %xmm4, %xmm3 # xmm3 = xmm4[0],mem[1,2,3,4,5,6,7]
vmovdqu 0xe(%r8,%r13), %xmm0
vpaddq %xmm24, %xmm18, %xmm18
vmovdqu 0x2c(%r8,%r13), %xmm2
vpblendw $0xfe, 0x1c(%r8,%r13), %xmm4, %xmm4 # xmm4 = xmm4[0],mem[1,2,3,4,5,6,7]
xorl %eax, %eax
vmovdqa64 %xmm23, %xmm5
vmovdqa64 %xmm22, %xmm6
vmovdqa %xmm14, %xmm7
vmovdqa64 %xmm18, %xmm8
vmovdqa %xmm14, %xmm9
vmovdqa64 %xmm20, %xmm10
vmovdqa64 %xmm21, %xmm11
movb $0x1, %cl
vaesenc %xmm5, %xmm1, %xmm1
vaesenc %xmm6, %xmm3, %xmm3
vaesenc %xmm10, %xmm0, %xmm0
vaesenc %xmm11, %xmm9, %xmm9
vaesenc %xmm5, %xmm8, %xmm8
vaesenc %xmm6, %xmm4, %xmm4
vaesenc %xmm10, %xmm2, %xmm2
vaesenc %xmm11, %xmm7, %xmm7
vpaddq %xmm21, %xmm5, %xmm5
vpaddq %xmm21, %xmm6, %xmm6
vpaddq %xmm21, %xmm10, %xmm10
vpaddq %xmm21, %xmm11, %xmm11
testb $0x1, %cl
movl $0x0, %ecx
jne 0x1ef3
vpunpckhdq %xmm1, %xmm3, %xmm12 # xmm12 = xmm3[2],xmm1[2],xmm3[3],xmm1[3]
vpunpckldq %xmm1, %xmm3, %xmm1 # xmm1 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
vpunpckhdq %xmm0, %xmm9, %xmm3 # xmm3 = xmm9[2],xmm0[2],xmm9[3],xmm0[3]
vpunpckldq %xmm0, %xmm9, %xmm0 # xmm0 = xmm9[0],xmm0[0],xmm9[1],xmm0[1]
vpunpckhdq %xmm1, %xmm0, %xmm9 # xmm9 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
vpunpckldq %xmm1, %xmm0, %xmm1 # xmm1 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
vpunpckldq %xmm3, %xmm12, %xmm0 # xmm0 = xmm12[0],xmm3[0],xmm12[1],xmm3[1]
vpunpckhdq %xmm3, %xmm12, %xmm3 # xmm3 = xmm12[2],xmm3[2],xmm12[3],xmm3[3]
vpunpckhdq %xmm8, %xmm4, %xmm12 # xmm12 = xmm4[2],xmm8[2],xmm4[3],xmm8[3]
vpunpckldq %xmm8, %xmm4, %xmm4 # xmm4 = xmm4[0],xmm8[0],xmm4[1],xmm8[1]
vpunpckhdq %xmm2, %xmm7, %xmm13 # xmm13 = xmm7[2],xmm2[2],xmm7[3],xmm2[3]
vpunpckldq %xmm2, %xmm7, %xmm2 # xmm2 = xmm7[0],xmm2[0],xmm7[1],xmm2[1]
vpunpckhdq %xmm4, %xmm2, %xmm7 # xmm7 = xmm2[2],xmm4[2],xmm2[3],xmm4[3]
vpunpckldq %xmm4, %xmm2, %xmm8 # xmm8 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
vpunpckldq %xmm13, %xmm12, %xmm2 # xmm2 = xmm12[0],xmm13[0],xmm12[1],xmm13[1]
vpunpckhdq %xmm13, %xmm12, %xmm4 # xmm4 = xmm12[2],xmm13[2],xmm12[3],xmm13[3]
incl %eax
cmpl $0xa, %eax
jne 0x1ef1
vmovdqa64 %xmm17, %xmm11
vpternlogq $0x96, %xmm8, %xmm1, %xmm11
vmovdqa64 %xmm16, %xmm10
vpternlogq $0x96, %xmm4, %xmm3, %xmm10
vpternlogq $0x96, %xmm2, %xmm0, %xmm15
addq $-0x3c, %r14
movl $0x3c, %eax
jmp 0x213f
movq %r14, %rax
imulq %rbx, %rax
movq %rax, 0x10(%rsp)
movq %r14, %rax
imulq %rbp, %rax
vpbroadcastq %rax, %ymm0
movb $0x7, %al
kmovd %eax, %k1
vmovdqu64 %ymm0, 0x6(%r12) {%k1}
vpaddq 0x11c1(%rip), %xmm18, %xmm18 # 0x31b0
vmovdqa64 %xmm18, 0x40(%rsp)
leaq (%r8,%r13), %rsi
movq %r12, %rdi
movq %r14, %rdx
vmovdqa %xmm15, 0x70(%rsp)
vmovdqa %xmm10, 0x60(%rsp)
vmovdqa %xmm11, 0x50(%rsp)
vzeroupper
callq 0x1090
vmovd 0x11bf(%rip), %xmm24    # 0x31e4
vpbroadcastq 0x10f9(%rip), %xmm23 # 0x3128
vpbroadcastq 0x10e7(%rip), %xmm22 # 0x3120
vpbroadcastq 0x10cd(%rip), %xmm21 # 0x3110
vpbroadcastq 0x10cb(%rip), %xmm20 # 0x3118
vmovd 0x117d(%rip), %xmm19    # 0x31d4
vmovdqa64 0x40(%rsp), %xmm18
vmovdqa 0x50(%rsp), %xmm11
movq (%rsp), %r8
vmovdqa 0x60(%rsp), %xmm10
vmovdqa 0x70(%rsp), %xmm15
vmovdqa 0x80(%rsp), %xmm14
movq 0x8(%rsp), %rdx
vmovdqa 0x10(%rsp), %xmm0
vmovdqa 0x20(%rsp), %xmm2
vpinsrq $0x1, 0x18(%rsp), %xmm0, %xmm1
vpinsrq $0x1, 0x28(%rsp), %xmm2, %xmm0
xorl %eax, %eax
vmovdqa64 %xmm23, %xmm2
vmovdqa %xmm14, %xmm3
vmovdqa64 %xmm18, %xmm5
vmovdqa64 %xmm22, %xmm4
vmovdqa64 %xmm21, %xmm6
vmovdqa64 %xmm20, %xmm7
movb $0x1, %cl
vaesenc %xmm2, %xmm5, %xmm5
vaesenc %xmm4, %xmm1, %xmm1
vaesenc %xmm7, %xmm0, %xmm0
vaesenc %xmm6, %xmm3, %xmm3
vpaddq %xmm21, %xmm2, %xmm2
vpaddq %xmm21, %xmm4, %xmm4
vpaddq %xmm21, %xmm7, %xmm7
vpaddq %xmm21, %xmm6, %xmm6
testb $0x1, %cl
movl $0x0, %ecx
jne 0x20c5
vpunpckhdq %xmm5, %xmm1, %xmm8 # xmm8 = xmm1[2],xmm5[2],xmm1[3],xmm5[3]
vpunpckldq %xmm5, %xmm1, %xmm1 # xmm1 = xmm1[0],xmm5[0],xmm1[1],xmm5[1]
vpunpckhdq %xmm0, %xmm3, %xmm9 # xmm9 = xmm3[2],xmm0[2],xmm3[3],xmm0[3]
vpunpckldq %xmm0, %xmm3, %xmm0 # xmm0 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
vpunpckhdq %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
vpunpckldq %xmm1, %xmm0, %xmm5 # xmm5 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
vpunpckldq %xmm9, %xmm8, %xmm0 # xmm0 = xmm8[0],xmm9[0],xmm8[1],xmm9[1]
vpunpckhdq %xmm9, %xmm8, %xmm1 # xmm1 = xmm8[2],xmm9[2],xmm8[3],xmm9[3]
incl %eax
cmpl $0xa, %eax
jne 0x20c3
vpxor %xmm5, %xmm11, %xmm11
vpxor %xmm1, %xmm10, %xmm10
vpxor %xmm0, %xmm15, %xmm15
cmpq $0x1d, %r14
jbe 0x214b
addq $-0x1e, %r14
movl $0x1e, %eax
addq %rax, %r13
testq %r14, %r14
jne 0x1e42
vpxor %xmm0, %xmm0, %xmm0
vpblendw $0x1, %xmm0, %xmm11, %xmm0 # xmm0 = xmm0[0],xmm11[1,2,3,4,5,6,7]
vpaddq 0x1063(%rip), %xmm0, %xmm2 # 0x31c0
vpbroadcastq 0xfb2(%rip), %xmm0 # 0x3118
vpbroadcastq 0xfa1(%rip), %xmm1 # 0x3110
vpbroadcastq 0xfa8(%rip), %xmm3 # 0x3120
vpbroadcastq 0xfa7(%rip), %xmm4 # 0x3128
xorl %eax, %eax
vmovdqa %xmm1, %xmm5
movb $0x1, %cl
vaesenc %xmm4, %xmm2, %xmm2
vaesenc %xmm3, %xmm10, %xmm10
vaesenc %xmm0, %xmm15, %xmm15
vaesenc %xmm5, %xmm14, %xmm14
vpaddq %xmm1, %xmm4, %xmm4
vpaddq %xmm1, %xmm3, %xmm3
vpaddq %xmm1, %xmm0, %xmm0
vpaddq %xmm1, %xmm5, %xmm5
testb $0x1, %cl
movl $0x0, %ecx
jne 0x2189
vpunpckhdq %xmm2, %xmm10, %xmm6 # xmm6 = xmm10[2],xmm2[2],xmm10[3],xmm2[3]
vpunpckldq %xmm2, %xmm10, %xmm2 # xmm2 = xmm10[0],xmm2[0],xmm10[1],xmm2[1]
vpunpckhdq %xmm15, %xmm14, %xmm7 # xmm7 = xmm14[2],xmm15[2],xmm14[3],xmm15[3]
vpunpckldq %xmm15, %xmm14, %xmm8 # xmm8 = xmm14[0],xmm15[0],xmm14[1],xmm15[1]
vpunpckhdq %xmm2, %xmm8, %xmm14 # xmm14 = xmm8[2],xmm2[2],xmm8[3],xmm2[3]
vpunpckldq %xmm2, %xmm8, %xmm2 # xmm2 = xmm8[0],xmm2[0],xmm8[1],xmm2[1]
vpunpckldq %xmm7, %xmm6, %xmm15 # xmm15 = xmm6[0],xmm7[0],xmm6[1],xmm7[1]
vpunpckhdq %xmm7, %xmm6, %xmm10 # xmm10 = xmm6[2],xmm7[2],xmm6[3],xmm7[3]
incl %eax
cmpl $0xa, %eax
jne 0x2187
vpxor (%rdx,%r15), %xmm2, %xmm0
xorl %eax, %eax
vptest %xmm0, %xmm0
setne %al
negl %eax
jmp 0x21f9
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq