// File: /workspace/github_c_makefile_star2_O1/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 0x21e7
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %r9, %r12
movq %rcx, %rbp
movq %rsi, %r14
movq %r9, %rcx
orq %rbp, %rcx
movq $0x0, (%rsi)
je 0x21d4
cmpq $0x10, %rbp
jb 0x21d6
movq %rdx, %rbx
movq 0x1c8(%rsp), %rcx
testq %rcx, %rcx
sete %al
testq %rdx, %rdx
sete %dl
orb %al, %dl
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jne 0x21d6
vmovdqu (%rcx), %xmm14
vpxor %xmm15, %xmm15, %xmm15
vpxor %xmm10, %xmm10, %xmm10
vpxor %xmm11, %xmm11, %xmm11
cmpq $0x10, %rbp
movq %r14, 0x8(%rsp)
vmovdqa %xmm14, 0x80(%rsp)
movq %r8, (%rsp)
je 0x1db9
movq %rdi, %r13
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 0x92(%rsp), %r9
vmovd 0x1ad1(%rip), %xmm19    # 0x31c0
xorl %r15d, %r15d
vmovd 0x1ac8(%rip), %xmm20    # 0x31c4
vpbroadcastq 0x1a12(%rip), %xmm21 # 0x3118
vpbroadcastq 0x1a00(%rip), %xmm22 # 0x3110
vpbroadcastq 0x1a06(%rip), %xmm23 # 0x3120
vpbroadcastq 0x1a04(%rip), %xmm24 # 0x3128
vxorps %xmm26, %xmm26, %xmm26
vmovdqa64 %xmm18, 0xc0(%rsp)
cmpq $0x6c, %rbp
jb 0x19d3
testq %r15, %r15
je 0x19d3
vmovdqa64 %xmm11, %xmm17
vmovdqa64 %xmm10, %xmm16
vpaddq %xmm20, %xmm19, %xmm10
vpaddq 0x19ff(%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
movl $0x1, %ecx
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
decl %ecx
je 0x17a4
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 0x179f
vmovdqa %xmm10, 0x10(%rsp)
vmovdqa %xmm11, 0x90(%rsp)
vmovdqu 0xe(%rbx,%r15), %xmm4
vmovdqu 0x1e(%rbx,%r15), %xmm2
vmovdqu 0x3c(%rbx,%r15), %xmm5
vmovdqu 0x4c(%rbx,%r15), %xmm3
vpxor %xmm7, %xmm7, %xmm7
vpblendw $0xfe, 0x2c(%rbx,%r15), %xmm7, %xmm6 # xmm6 = xmm7[0],mem[1,2,3,4,5,6,7]
vpblendw $0xfe, -0x2(%rbx,%r15), %xmm7, %xmm7 # xmm7 = xmm7[0],mem[1,2,3,4,5,6,7]
vmovd 0x1940(%rip), %xmm25    # 0x31c8
vpxorq %xmm25, %xmm6, %xmm6
vpxorq %xmm25, %xmm7, %xmm7
vpxor %xmm7, %xmm10, %xmm10
vmovdqa %xmm10, 0x10(%rsp)
vpxor %xmm4, %xmm13, %xmm10
vpxor %xmm2, %xmm12, %xmm12
vpxor %xmm6, %xmm11, %xmm11
vmovdqa %xmm11, 0x90(%rsp)
vpxor %xmm5, %xmm9, %xmm9
movq (%rdi), %rax
movq 0x6(%rdi), %rcx
movq %rcx, 0x6(%r13,%r15)
movq %rax, (%r13,%r15)
vmovdqu %xmm10, 0xe(%r13,%r15)
vpxor %xmm3, %xmm8, %xmm8
vmovdqu %xmm12, 0x1e(%r13,%r15)
movq (%r9), %rax
movq 0x6(%r9), %rcx
movq %rax, 0x2e(%r13,%r15)
movq %rcx, 0x34(%r13,%r15)
vmovdqu %xmm9, 0x3c(%r13,%r15)
vmovdqu %xmm8, 0x4c(%r13,%r15)
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm8
vmovdqa64 %xmm23, %xmm9
vmovdqa64 %xmm21, %xmm10
vmovdqa64 %xmm22, %xmm11
movl $0x1, %ecx
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
decl %ecx
je 0x1918
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 0x1913
vpxor %xmm6, %xmm7, %xmm7
vpxor %xmm5, %xmm4, %xmm5
vpxor %xmm3, %xmm2, %xmm9
addq $0x5c, %r15
addq $-0x5c, %rbp
movq %r15, (%r14)
vmovdqa64 %xmm16, %xmm10
vmovdqa64 %xmm17, %xmm11
jmp 0x1da2
cmpq $0x3e, %rbp
jae 0x19e3
vpaddq 0x179d(%rip), %xmm19, %xmm19 # 0x3180
vpaddq %xmm20, %xmm19, %xmm19
vpxor %xmm6, %xmm6, %xmm6
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm0
vmovdqa64 %xmm18, %xmm12
vmovdqa64 %xmm19, %xmm13
vmovdqa64 %xmm23, %xmm1
vmovdqa64 %xmm22, %xmm2
vmovdqa64 %xmm21, %xmm3
movl $0x1, %ecx
vaesenc %xmm0, %xmm13, %xmm13
vaesenc %xmm1, %xmm6, %xmm6
vaesenc %xmm3, %xmm12, %xmm12
vaesenc %xmm2, %xmm14, %xmm14
vpaddq %xmm22, %xmm0, %xmm0
vpaddq %xmm22, %xmm1, %xmm1
vpaddq %xmm22, %xmm3, %xmm3
vpaddq %xmm22, %xmm2, %xmm2
decl %ecx
je 0x1a18
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, %xmm14, %xmm6 # xmm6 = xmm14[2],xmm12[2],xmm14[3],xmm12[3]
vpunpckldq %xmm12, %xmm14, %xmm7 # xmm7 = xmm14[0],xmm12[0],xmm14[1],xmm12[1]
vpunpckhdq %xmm5, %xmm7, %xmm14 # xmm14 = 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 0x1a13
vmovups %ymm26, 0x10(%rsp)
vmovups %ymm26, 0x20(%rsp)
leaq (%rbx,%r15), %rsi
cmpq $0x3e, %rbp
vmovdqa %xmm15, 0x70(%rsp)
vmovdqa %xmm10, 0x60(%rsp)
vmovdqa %xmm11, 0x50(%rsp)
vmovdqa64 %xmm19, 0x40(%rsp)
vmovdqa %xmm14, 0x100(%rsp)
vmovdqa %xmm12, 0xf0(%rsp)
vmovdqa %xmm6, 0xe0(%rsp)
vmovdqa %xmm13, 0xd0(%rsp)
jb 0x1b06
vmovss 0x16f2(%rip), %xmm0     # 0x31c8
vmovaps %xmm0, 0x10(%rsp)
vmovdqu (%rsi), %ymm0
vmovdqu 0xe(%rsi), %ymm1
vmovdqu %ymm1, 0xe(%rdi)
vmovdqu %ymm0, (%rdi)
vmovups %ymm26, 0x120(%rsp)
vmovups %ymm26, 0x110(%rsp)
jmp 0x1b8c
vmovss 0x16be(%rip), %xmm0     # 0x31cc
vmovaps %xmm0, 0x10(%rsp)
leaq -0x10(%rbp), %r14
movq %r14, %rdx
vzeroupper
callq 0x1090
vpbroadcastb %r14d, %xmm0
vmovdqa %xmm0, 0x170(%rsp)
movq 0x8(%rsp), %r14
leaq -0xe(%rbp), %rdx
vpcmpeqd %ymm0, %ymm0, %ymm0
vmovdqu %ymm0, 0x110(%rsp)
vmovdqu %ymm0, 0x120(%rsp)
leaq 0x110(%rsp), %rdi
xorl %esi, %esi
vzeroupper
callq 0x1030
vmovdqa 0xd0(%rsp), %xmm13
vmovdqa 0xe0(%rsp), %xmm6
vmovdqa 0xf0(%rsp), %xmm12
vxorps %xmm26, %xmm26, %xmm26
leaq 0x92(%rsp), %r9
leaq (%r15,%r13), %rdi
vmovdqa 0x10(%rsp), %xmm7
vmovdqa 0x20(%rsp), %xmm5
vmovdqa 0x30(%rsp), %xmm9
vpxor %xmm7, %xmm13, %xmm0
vmovdqa %xmm0, 0x90(%rsp)
vpxor %xmm6, %xmm5, %xmm0
vmovdqa %xmm0, 0xa0(%rsp)
vpxor %xmm12, %xmm9, %xmm0
vmovdqa %xmm0, 0xb0(%rsp)
cmpq $0x3e, %rbp
jb 0x1be6
vmovdqu (%r9), %ymm0
vmovdqu 0xe(%r9), %ymm1
vmovdqu %ymm1, 0xe(%rdi)
vmovdqu %ymm0, (%rdi)
jmp 0x1c54
leaq -0x10(%rbp), %rdx
movq %r9, %rsi
vmovdqa %xmm7, 0x160(%rsp)
vmovdqa %xmm9, 0x150(%rsp)
vmovdqa %xmm5, 0x140(%rsp)
vzeroupper
callq 0x1090
vmovdqa 0xd0(%rsp), %xmm13
vmovdqa 0xe0(%rsp), %xmm6
vmovdqa 0xf0(%rsp), %xmm12
vmovdqa 0x140(%rsp), %xmm5
vmovdqa 0x150(%rsp), %xmm9
vmovdqa 0x160(%rsp), %xmm7
vxorps %xmm26, %xmm26, %xmm26
leaq 0x92(%rsp), %r9
vmovdqa 0x80(%rsp), %xmm14
vmovdqa 0x70(%rsp), %xmm15
vmovdqa 0x60(%rsp), %xmm10
movq (%rsp), %r8
vmovdqa 0x50(%rsp), %xmm11
vmovdqa64 0xc0(%rsp), %xmm18
vmovdqa64 0x40(%rsp), %xmm19
vmovd 0x1537(%rip), %xmm20    # 0x31c4
vpbroadcastq 0x1481(%rip), %xmm21 # 0x3118
vpbroadcastq 0x146f(%rip), %xmm22 # 0x3110
vpbroadcastq 0x1475(%rip), %xmm23 # 0x3120
vpbroadcastq 0x1473(%rip), %xmm24 # 0x3128
vmovdqa 0x100(%rsp), %xmm8
vmovups %ymm26, 0xa0(%rsp)
vmovups %ymm26, 0x90(%rsp)
vmovdqa 0x170(%rsp), %xmm1
vpxor %xmm1, %xmm13, %xmm0
vpternlogq $0xd8, 0x110(%rsp), %xmm0, %xmm7
vpxor %xmm6, %xmm1, %xmm0
vpternlogq $0xd8, 0x120(%rsp), %xmm0, %xmm5
vpxor %xmm1, %xmm12, %xmm0
vpternlogq $0xd8, 0x130(%rsp), %xmm0, %xmm9
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm0
vmovdqa64 %xmm23, %xmm1
vmovdqa64 %xmm22, %xmm2
vmovdqa64 %xmm21, %xmm3
leaq 0x12(%rsp), %rdi
movl $0x1, %ecx
vaesenc %xmm0, %xmm7, %xmm7
vaesenc %xmm1, %xmm5, %xmm5
vaesenc %xmm3, %xmm9, %xmm9
vaesenc %xmm2, %xmm8, %xmm8
vpaddq %xmm22, %xmm0, %xmm0
vpaddq %xmm22, %xmm1, %xmm1
vpaddq %xmm22, %xmm3, %xmm3
vpaddq %xmm22, %xmm2, %xmm2
decl %ecx
je 0x1d25
vpunpckhdq %xmm7, %xmm5, %xmm4 # xmm4 = xmm5[2],xmm7[2],xmm5[3],xmm7[3]
vpunpckldq %xmm7, %xmm5, %xmm5 # xmm5 = xmm5[0],xmm7[0],xmm5[1],xmm7[1]
vpunpckhdq %xmm9, %xmm8, %xmm6 # xmm6 = xmm8[2],xmm9[2],xmm8[3],xmm9[3]
vpunpckldq %xmm9, %xmm8, %xmm7 # xmm7 = xmm8[0],xmm9[0],xmm8[1],xmm9[1]
vpunpckhdq %xmm5, %xmm7, %xmm8 # xmm8 = xmm7[2],xmm5[2],xmm7[3],xmm5[3]
vpunpckldq %xmm5, %xmm7, %xmm7 # xmm7 = xmm7[0],xmm5[0],xmm7[1],xmm5[1]
vpunpckldq %xmm6, %xmm4, %xmm9 # xmm9 = 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 0x1d20
leaq -0x10(%rbp), %rax
cmpq $0x3e, %rbp
leaq -0x2e(%rbp), %rbp
movl $0x2e, %ecx
cmovaeq %rcx, %rax
movl $0x10, %ecx
cmovbq %rcx, %rbp
addq %rax, %r15
movq %r15, (%r14)
vpxor %xmm9, %xmm15, %xmm15
vpxor %xmm5, %xmm10, %xmm10
vpxor %xmm7, %xmm11, %xmm11
cmpq $0x10, %rbp
ja 0x1732
testq %r12, %r12
je 0x2127
testq %r8, %r8
je 0x21eb
movabsq $0x101010101010000, %rax # imm = 0x101010101010000
leaq 0x12(%rsp), %r13
vmovd 0x13ec(%rip), %xmm18    # 0x31d0
vmovd 0x13d6(%rip), %xmm19    # 0x31c4
vpbroadcastq 0x1320(%rip), %xmm20 # 0x3118
vpbroadcastq 0x130e(%rip), %xmm21 # 0x3110
xorl %edx, %edx
vpbroadcastq 0x1312(%rip), %xmm22 # 0x3120
vpbroadcastq 0x1310(%rip), %xmm23 # 0x3128
movl $0x1e, %ebp
leaq 0x101(%rax), %r14
vmovd 0x13a6(%rip), %xmm24    # 0x31d4
xorl %r15d, %r15d
cmpq $0x3d, %r12
setb %al
testq %r15, %r15
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x1e82
cmpq $0x1e, %r12
jae 0x1e55
vpaddq 0x132b(%rip), %xmm18, %xmm18 # 0x3180
movq $0x0, 0x10(%rsp)
jb 0x1fa3
vmovdqu (%r8,%r15), %xmm0
vmovdqu 0xe(%r8,%r15), %xmm1
vmovdqu %xmm1, 0xe(%r13)
vmovdqu %xmm0, (%r13)
jmp 0x2067
vmovdqa64 %xmm11, %xmm17
vmovdqa64 %xmm10, %xmm16
vpaddq %xmm19, %xmm18, %xmm0
vpxor %xmm4, %xmm4, %xmm4
vpblendw $0xfe, -0x2(%r8,%r15), %xmm4, %xmm3 # xmm3 = xmm4[0],mem[1,2,3,4,5,6,7]
vmovdqu 0xe(%r8,%r15), %xmm1
vpaddq %xmm24, %xmm18, %xmm18
vmovdqu 0x2c(%r8,%r15), %xmm2
vpblendw $0xfe, 0x1c(%r8,%r15), %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, %xmm9
vmovdqa %xmm14, %xmm8
vmovdqa64 %xmm20, %xmm10
vmovdqa64 %xmm21, %xmm11
movl $0x1, %ecx
vaesenc %xmm5, %xmm0, %xmm0
vaesenc %xmm6, %xmm3, %xmm3
vaesenc %xmm10, %xmm1, %xmm1
vaesenc %xmm11, %xmm8, %xmm8
vaesenc %xmm5, %xmm9, %xmm9
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
decl %ecx
je 0x1eea
vpunpckhdq %xmm0, %xmm3, %xmm12 # xmm12 = xmm3[2],xmm0[2],xmm3[3],xmm0[3]
vpunpckldq %xmm0, %xmm3, %xmm0 # xmm0 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
vpunpckhdq %xmm1, %xmm8, %xmm3 # xmm3 = xmm8[2],xmm1[2],xmm8[3],xmm1[3]
vpunpckldq %xmm1, %xmm8, %xmm1 # xmm1 = xmm8[0],xmm1[0],xmm8[1],xmm1[1]
vpunpckhdq %xmm0, %xmm1, %xmm8 # xmm8 = xmm1[2],xmm0[2],xmm1[3],xmm0[3]
vpunpckldq %xmm0, %xmm1, %xmm0 # xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
vpunpckldq %xmm3, %xmm12, %xmm1 # xmm1 = xmm12[0],xmm3[0],xmm12[1],xmm3[1]
vpunpckhdq %xmm3, %xmm12, %xmm3 # xmm3 = xmm12[2],xmm3[2],xmm12[3],xmm3[3]
vpunpckhdq %xmm9, %xmm4, %xmm12 # xmm12 = xmm4[2],xmm9[2],xmm4[3],xmm9[3]
vpunpckldq %xmm9, %xmm4, %xmm4 # xmm4 = xmm4[0],xmm9[0],xmm4[1],xmm9[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, %xmm9 # xmm9 = 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 0x1ee5
vpxor %xmm0, %xmm9, %xmm5
vpxor %xmm4, %xmm3, %xmm3
vpxor %xmm2, %xmm1, %xmm0
addq $-0x3c, %r12
movl $0x3c, %eax
vmovdqa64 %xmm16, %xmm10
vmovdqa64 %xmm17, %xmm11
jmp 0x210f
movq %r12, %rax
movabsq $0x101010101010000, %rcx # imm = 0x101010101010000
imulq %rcx, %rax
movq %rax, 0x10(%rsp)
movq %r12, %rax
imulq %r14, %rax
vpbroadcastq %rax, %ymm0
movb $0x7, %al
kmovd %eax, %k1
vmovdqu64 %ymm0, 0x6(%r13) {%k1}
leaq (%r8,%r15), %rsi
movq %r13, %rdi
movq %r12, %rdx
vmovdqa %xmm15, 0x70(%rsp)
vmovdqa %xmm10, 0x60(%rsp)
vmovdqa %xmm11, 0x50(%rsp)
vmovdqa64 %xmm18, 0x40(%rsp)
vzeroupper
callq 0x1090
vmovd 0x11c8(%rip), %xmm24    # 0x31d4
vpbroadcastq 0x1112(%rip), %xmm23 # 0x3128
vpbroadcastq 0x1100(%rip), %xmm22 # 0x3120
xorl %edx, %edx
vpbroadcastq 0x10e4(%rip), %xmm21 # 0x3110
vpbroadcastq 0x10e2(%rip), %xmm20 # 0x3118
vmovd 0x1184(%rip), %xmm19    # 0x31c4
vmovdqa64 0x40(%rsp), %xmm18
vmovdqa 0x50(%rsp), %xmm11
movq (%rsp), %r8
vmovdqa 0x60(%rsp), %xmm10
vmovdqa 0x70(%rsp), %xmm15
vmovdqa 0x80(%rsp), %xmm14
vpaddq %xmm19, %xmm18, %xmm18
vmovdqa 0x10(%rsp), %xmm3
vmovdqa 0x20(%rsp), %xmm0
xorl %eax, %eax
vmovdqa64 %xmm23, %xmm1
vmovdqa %xmm14, %xmm2
vmovdqa64 %xmm18, %xmm5
vmovdqa64 %xmm22, %xmm4
vmovdqa64 %xmm21, %xmm6
vmovdqa64 %xmm20, %xmm7
movl $0x1, %ecx
vaesenc %xmm1, %xmm5, %xmm5
vaesenc %xmm4, %xmm3, %xmm3
vaesenc %xmm7, %xmm0, %xmm0
vaesenc %xmm6, %xmm2, %xmm2
vpaddq %xmm21, %xmm1, %xmm1
vpaddq %xmm21, %xmm4, %xmm4
vpaddq %xmm21, %xmm7, %xmm7
vpaddq %xmm21, %xmm6, %xmm6
decl %ecx
je 0x20a2
vpunpckhdq %xmm5, %xmm3, %xmm8 # xmm8 = xmm3[2],xmm5[2],xmm3[3],xmm5[3]
vpunpckldq %xmm5, %xmm3, %xmm3 # xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1]
vpunpckhdq %xmm0, %xmm2, %xmm9 # xmm9 = xmm2[2],xmm0[2],xmm2[3],xmm0[3]
vpunpckldq %xmm0, %xmm2, %xmm0 # xmm0 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
vpunpckhdq %xmm3, %xmm0, %xmm2 # xmm2 = xmm0[2],xmm3[2],xmm0[3],xmm3[3]
vpunpckldq %xmm3, %xmm0, %xmm5 # xmm5 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
vpunpckldq %xmm9, %xmm8, %xmm0 # xmm0 = xmm8[0],xmm9[0],xmm8[1],xmm9[1]
vpunpckhdq %xmm9, %xmm8, %xmm3 # xmm3 = xmm8[2],xmm9[2],xmm8[3],xmm9[3]
incl %eax
cmpl $0xa, %eax
jne 0x209d
cmpq $0x1e, %r12
movq %r12, %rax
leaq -0x1e(%r12), %r12
cmovbq %rdx, %r12
cmovaeq %rbp, %rax
vpxor %xmm0, %xmm15, %xmm15
vpxor %xmm3, %xmm10, %xmm10
vpxor %xmm5, %xmm11, %xmm11
addq %rax, %r15
testq %r12, %r12
jne 0x1e31
vpxor %xmm0, %xmm0, %xmm0
vpblendw $0x1, %xmm0, %xmm11, %xmm0 # xmm0 = xmm0[0],xmm11[1,2,3,4,5,6,7]
vpaddq 0x1077(%rip), %xmm0, %xmm1 # 0x31b0
vpbroadcastq 0xfd6(%rip), %xmm0 # 0x3118
vpbroadcastq 0xfc5(%rip), %xmm2 # 0x3110
vpbroadcastq 0xfcc(%rip), %xmm3 # 0x3120
vpbroadcastq 0xfcb(%rip), %xmm4 # 0x3128
xorl %eax, %eax
vmovdqa %xmm2, %xmm5
movq 0x8(%rsp), %rdx
movl $0x1, %ecx
vaesenc %xmm4, %xmm1, %xmm1
vaesenc %xmm3, %xmm10, %xmm10
vaesenc %xmm0, %xmm15, %xmm15
vaesenc %xmm5, %xmm14, %xmm14
vpaddq %xmm2, %xmm4, %xmm4
vpaddq %xmm2, %xmm3, %xmm3
vpaddq %xmm2, %xmm0, %xmm0
vpaddq %xmm2, %xmm5, %xmm5
decl %ecx
je 0x216d
vpunpckhdq %xmm1, %xmm10, %xmm6 # xmm6 = xmm10[2],xmm1[2],xmm10[3],xmm1[3]
vpunpckldq %xmm1, %xmm10, %xmm1 # xmm1 = xmm10[0],xmm1[0],xmm10[1],xmm1[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 %xmm1, %xmm8, %xmm14 # xmm14 = xmm8[2],xmm1[2],xmm8[3],xmm1[3]
vpunpckldq %xmm1, %xmm8, %xmm1 # xmm1 = xmm8[0],xmm1[0],xmm8[1],xmm1[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 0x2168
movq (%rdx), %rax
vpxor (%rbx,%rax), %xmm1, %xmm0
xorl %eax, %eax
vptest %xmm0, %xmm0
setne %al
negl %eax
jmp 0x21d6
xorl %eax, %eax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
jmp 0x21d6