// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/paeq128/aesni/encrypt.cpp
// Function: PAEQ128_opt_AESNI_encrypt(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_encrypt(
	unsigned char *c, unsigned long long *clen,
	const unsigned char *m, unsigned long long mlen,
	const unsigned char *ad, unsigned long long adlen,
	const unsigned char *npub,
	const unsigned char *k
	)

{

	if (clen == NULL)
		return -1;
	if ((mlen == 0) && (adlen == 0))
	{
		*clen = 0;
		return 0;
	}

	//Assume that we do encryption and/or authentication so we need a key and a ciphertext pointer valid
	if ((k == NULL) || (c == NULL))
		return -2;

	if (npub == NULL)
		return -7;

	//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 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);
	(*clen) = 0;

	//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);  //Also sets counter to 0
	memset(BlockOutput, 0, 64);
	memset(BlockMiddle, 0, 64);
	memset(BlockMiddle, 0, 64);

	//1.3 Setting first block: Constant (bytes 0-1) || Counter (bytes 2-35) || Nonce (bytes 36-47) || Key (bytes 48-63)
	//1.3.1 Domain separation
	BlockInput[0] = D0;  //Domain separation constant

	//1.3.2 Nonce
	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);   

	//1.3.3 Key
	__m128i Key = _mm_set_epi64x(*((uint64_t*)(k + 8)), (*((uint64_t*)k)));
	BlockInput[3] = Key;

	unsigned long long encrypted_bytes = 0;//Encrypted bytes counter

	//Encryption part
	if (mlen != 0)
	{
		if (m == NULL)
			return -3;

		while ((mlen>0))
		{
			// I. First layer 

			if ((mlen < 2 * CRYPTO_MBLOCK) || (encrypted_bytes == 0))
			{

				//1. Domain-separation constant
				if (mlen < CRYPTO_MBLOCK) //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 plaintext buffers
				__m128i plaintext128[3];
				uint64_t plaintext_buffer[6];
				uint64_t ciphertext_buffer[6];
				plaintext_buffer[0] = D_left + 2; //Making D2
				if (mlen >= CRYPTO_MBLOCK)//Full block encryption
					memcpy(((char*)plaintext_buffer) + 2, m + encrypted_bytes, CRYPTO_MBLOCK);
				else
				{
					plaintext_buffer[0]++; //Making D3
					//Filling buffers with mlen
					plaintext_buffer[0] ^= (((uint64_t)mlen * 0x01010101) << 32) ^ ((uint64_t)mlen * 0x01010000);
					for (unsigned i = 1; i < 6; ++i)
						plaintext_buffer[i] = (((uint64_t)mlen * 0x01010101) << 32) ^ ((uint64_t)mlen * 0x01010101);
					memcpy(((char*)plaintext_buffer) + 2, m + encrypted_bytes, mlen);
				}

				//2. Working with BlockMiddle
				plaintext128[0] = _mm_set_epi64x(plaintext_buffer[1], plaintext_buffer[0]);
				plaintext128[1] = _mm_set_epi64x(plaintext_buffer[3], plaintext_buffer[2]);
				plaintext128[2] = _mm_set_epi64x(plaintext_buffer[5], plaintext_buffer[4]);

				BlockMiddle[0] = _mm_and_si128(BlockMiddle[0], Dmask); //Clearing first two bytes
				BlockMiddle[0] = _mm_xor_si128(BlockMiddle[0], plaintext128[0]);
				BlockMiddle[1] = _mm_xor_si128(BlockMiddle[1], plaintext128[1]);
				BlockMiddle[2] = _mm_xor_si128(BlockMiddle[2], plaintext128[2]);

				//Ciphertext extraction
				_mm_storeu_si128((__m128i*)ciphertext_buffer, BlockMiddle[0]);
				_mm_storeu_si128((__m128i*)(ciphertext_buffer+2), BlockMiddle[1]);
				_mm_storeu_si128((__m128i*)(ciphertext_buffer+4), BlockMiddle[2]);

				if (mlen >= CRYPTO_MBLOCK)
					memcpy(c + encrypted_bytes, ((char*)ciphertext_buffer) + 2, CRYPTO_MBLOCK);
				else //Last incomplete block
					memcpy(c + encrypted_bytes, ((char*)ciphertext_buffer) + 2, mlen);
				memset(ciphertext_buffer, 0, 6 * sizeof(uint64_t));

				//Counters increment
				if (mlen >= CRYPTO_MBLOCK)
				{
					encrypted_bytes += CRYPTO_MBLOCK;
					mlen -= CRYPTO_MBLOCK;
				}
				else
				{
					encrypted_bytes += mlen;
					mlen = 0;
				}
				(*clen) = encrypted_bytes;

				//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]);
			}//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. Loading plaintext
				__m128i plaintext_buffer[6];  //96-byte storage
				plaintext_buffer[0] = _mm_loadu_si128((__m128i*)(m + encrypted_bytes - 2));   //Bytes [0:13]
				plaintext_buffer[1] = _mm_loadu_si128((__m128i*)(m + encrypted_bytes + 14));  //Bytes [14:29]
				plaintext_buffer[2] = _mm_loadu_si128((__m128i*)(m + encrypted_bytes + 30));  //Bytes [30:45]
				plaintext_buffer[3] = _mm_loadu_si128((__m128i*)(m + encrypted_bytes + 44));  //Bytes [0:13]
				plaintext_buffer[4] = _mm_loadu_si128((__m128i*)(m + encrypted_bytes + 60));   //Bytes [14:29]
				plaintext_buffer[5] = _mm_loadu_si128((__m128i*)(m + encrypted_bytes + 76));  //Bytes [30:45]

				//4. 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);

				//5. Xoring plaintext
				plaintext_buffer[0] = _mm_and_si128(plaintext_buffer[0], Dmask); //Clearing first two bytes
				plaintext_buffer[3] = _mm_and_si128(plaintext_buffer[3], Dmask); //Clearing first two bytes
				BlockExtraMiddle[0] = _mm_xor_si128(BlockExtraMiddle[0], plaintext_buffer[0]);
				BlockExtraMiddle[1] = _mm_xor_si128(BlockExtraMiddle[1], plaintext_buffer[1]);
				BlockExtraMiddle[2] = _mm_xor_si128(BlockExtraMiddle[2], plaintext_buffer[2]);
				BlockMiddle[0] = _mm_xor_si128(BlockMiddle[0], plaintext_buffer[3]);
				BlockMiddle[1] = _mm_xor_si128(BlockMiddle[1], plaintext_buffer[4]);
				BlockMiddle[2] = _mm_xor_si128(BlockMiddle[2], plaintext_buffer[5]);

				//6. Extracting ciphertext
				memcpy(c + encrypted_bytes, ((char*)BlockExtraMiddle) + 2, CRYPTO_MBLOCK);
				memcpy(c + encrypted_bytes + 46, ((char*)BlockMiddle) + 2, 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
				encrypted_bytes += 2 * CRYPTO_MBLOCK;
				mlen -= 2 * CRYPTO_MBLOCK;
				(*clen) = encrypted_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. Truncation
	memcpy(c + (*clen), Tag, CRYPTO_ABYTES);
	*clen += CRYPTO_ABYTES;


	//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);



	return 0;
}

// Assembly:
testq %rsi, %rsi
je 0x2ddf
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %r9, %r12
movq %rcx, %rbp
movq %r9, %rax
orq %rcx, %rax
je 0x2de5
movq %rdx, %r13
movq %rdi, %r14
movq 0x188(%rsp), %rcx
testq %rcx, %rcx
sete %al
testq %rdi, %rdi
sete %dl
orb %al, %dl
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jne 0x2dee
movq 0x180(%rsp), %rax
testq %rax, %rax
je 0x2e03
movq $0x0, (%rsi)
vpxor %xmm0, %xmm0, %xmm0
vmovdqa %xmm0, (%rsp)
vmovdqu (%rcx), %xmm14
vpxor %xmm15, %xmm15, %xmm15
vpxor %xmm10, %xmm10, %xmm10
vpxor %xmm11, %xmm11, %xmm11
testq %rbp, %rbp
movq %rsi, 0x18(%rsp)
vmovdqa %xmm14, 0x90(%rsp)
movq %r8, 0x10(%rsp)
je 0x29a0
testq %r13, %r13
je 0x2e0a
movq (%rax), %rcx
shlq $0x20, %rcx
vmovq 0x4(%rax), %xmm0
vmovq %rcx, %xmm1
vpunpcklqdq %xmm0, %xmm1, %xmm18 # xmm18 = xmm1[0],xmm0[0]
movabsq $0x101010101010000, %rax # imm = 0x101010101010000
leaq 0xb2(%rsp), %rbx
vmovd 0xeef(%rip), %xmm19     # 0x31c0
vmovd 0xee9(%rip), %xmm20     # 0x31c4
vpbroadcastq 0xe33(%rip), %xmm21 # 0x3118
vpbroadcastq 0xe21(%rip), %xmm22 # 0x3110
vpbroadcastq 0xe27(%rip), %xmm23 # 0x3120
vpbroadcastq 0xe25(%rip), %xmm24 # 0x3128
addq $0x101, %rax            # imm = 0x101
movq %rax, 0xa8(%rsp)
xorl %r15d, %r15d
vmovdqa64 %xmm18, 0xe0(%rsp)
cmpq $0x5c, %rbp
setb %al
testq %r15, %r15
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2431
cmpq $0x2e, %rbp
jae 0x2344
vpaddq 0xe3c(%rip), %xmm19, %xmm19 # 0x3180
vpaddq %xmm20, %xmm19, %xmm19
vpxor %xmm6, %xmm6, %xmm6
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm0
vmovdqa %xmm14, %xmm8
vmovdqa64 %xmm18, %xmm9
vmovdqa64 %xmm19, %xmm2
vmovdqa64 %xmm23, %xmm1
vmovdqa64 %xmm22, %xmm3
vmovdqa64 %xmm21, %xmm4
movl $0x1, %ecx
vaesenc %xmm0, %xmm2, %xmm2
vaesenc %xmm1, %xmm6, %xmm6
vaesenc %xmm4, %xmm9, %xmm9
vaesenc %xmm3, %xmm8, %xmm8
vpaddq %xmm22, %xmm0, %xmm0
vpaddq %xmm22, %xmm1, %xmm1
vpaddq %xmm22, %xmm4, %xmm4
vpaddq %xmm22, %xmm3, %xmm3
decl %ecx
je 0x237e
vpunpckhdq %xmm2, %xmm6, %xmm5 # xmm5 = xmm6[2],xmm2[2],xmm6[3],xmm2[3]
vpunpckldq %xmm2, %xmm6, %xmm2 # xmm2 = xmm6[0],xmm2[0],xmm6[1],xmm2[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 %xmm2, %xmm7, %xmm8 # xmm8 = xmm7[2],xmm2[2],xmm7[3],xmm2[3]
vpunpckldq %xmm2, %xmm7, %xmm2 # xmm2 = xmm7[0],xmm2[0],xmm7[1],xmm2[1]
vpunpckldq %xmm6, %xmm5, %xmm9 # xmm9 = xmm5[0],xmm6[0],xmm5[1],xmm6[1]
vpunpckhdq %xmm6, %xmm5, %xmm6 # xmm6 = xmm5[2],xmm6[2],xmm5[3],xmm6[3]
incl %eax
cmpl $0xa, %eax
jne 0x2379
vmovdqa %xmm2, (%rsp)
movq $0x8062, 0xb0(%rsp) # imm = 0x8062
cmpq $0x2e, %rbp
vmovdqa %xmm15, 0x60(%rsp)
vmovdqa %xmm10, 0x50(%rsp)
vmovdqa %xmm11, 0x40(%rsp)
vmovdqa64 %xmm19, 0x30(%rsp)
vmovdqa %xmm8, 0xf0(%rsp)
jb 0x26ad
vmovdqu (%r13,%r15), %ymm0
vmovdqu 0xe(%r13,%r15), %ymm1
vmovdqu %ymm1, 0xe(%rbx)
vmovdqu %ymm0, (%rbx)
jmp 0x27b8
vmovdqa64 %xmm11, %xmm17
vmovdqa64 %xmm10, %xmm16
vpaddq %xmm20, %xmm19, %xmm2
vpaddq 0xd13(%rip), %xmm19, %xmm19 # 0x3160
vpxor %xmm3, %xmm3, %xmm3
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm8
vmovdqa64 %xmm23, %xmm9
vmovdqa %xmm14, %xmm0
vmovdqa64 %xmm18, %xmm6
vmovdqa64 %xmm19, %xmm7
vmovdqa %xmm14, %xmm1
vmovdqa64 %xmm18, %xmm5
vpxor %xmm4, %xmm4, %xmm4
vmovdqa64 %xmm21, %xmm10
vmovdqa64 %xmm22, %xmm11
movl $0x1, %ecx
vaesenc %xmm8, %xmm2, %xmm2
vaesenc %xmm9, %xmm4, %xmm4
vaesenc %xmm10, %xmm5, %xmm5
vaesenc %xmm11, %xmm1, %xmm1
vaesenc %xmm8, %xmm7, %xmm7
vaesenc %xmm9, %xmm3, %xmm3
vaesenc %xmm10, %xmm6, %xmm6
vaesenc %xmm11, %xmm0, %xmm0
vpaddq %xmm22, %xmm8, %xmm8
vpaddq %xmm22, %xmm9, %xmm9
vpaddq %xmm22, %xmm10, %xmm10
vpaddq %xmm22, %xmm11, %xmm11
decl %ecx
je 0x248e
vpunpckhdq %xmm2, %xmm4, %xmm12 # xmm12 = xmm4[2],xmm2[2],xmm4[3],xmm2[3]
vpunpckldq %xmm2, %xmm4, %xmm2 # xmm2 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
vpunpckhdq %xmm5, %xmm1, %xmm4 # xmm4 = xmm1[2],xmm5[2],xmm1[3],xmm5[3]
vpunpckldq %xmm5, %xmm1, %xmm5 # xmm5 = xmm1[0],xmm5[0],xmm1[1],xmm5[1]
vpunpckhdq %xmm2, %xmm5, %xmm1 # xmm1 = xmm5[2],xmm2[2],xmm5[3],xmm2[3]
vpunpckldq %xmm2, %xmm5, %xmm2 # xmm2 = xmm5[0],xmm2[0],xmm5[1],xmm2[1]
vpunpckldq %xmm4, %xmm12, %xmm5 # xmm5 = xmm12[0],xmm4[0],xmm12[1],xmm4[1]
vpunpckhdq %xmm4, %xmm12, %xmm4 # xmm4 = xmm12[2],xmm4[2],xmm12[3],xmm4[3]
vpunpckhdq %xmm7, %xmm3, %xmm12 # xmm12 = xmm3[2],xmm7[2],xmm3[3],xmm7[3]
vpunpckldq %xmm7, %xmm3, %xmm3 # xmm3 = xmm3[0],xmm7[0],xmm3[1],xmm7[1]
vpunpckhdq %xmm6, %xmm0, %xmm13 # xmm13 = xmm0[2],xmm6[2],xmm0[3],xmm6[3]
vpunpckldq %xmm6, %xmm0, %xmm6 # xmm6 = xmm0[0],xmm6[0],xmm0[1],xmm6[1]
vpunpckhdq %xmm3, %xmm6, %xmm0 # xmm0 = xmm6[2],xmm3[2],xmm6[3],xmm3[3]
vpunpckldq %xmm3, %xmm6, %xmm7 # xmm7 = xmm6[0],xmm3[0],xmm6[1],xmm3[1]
vpunpckldq %xmm13, %xmm12, %xmm6 # xmm6 = xmm12[0],xmm13[0],xmm12[1],xmm13[1]
vpunpckhdq %xmm13, %xmm12, %xmm3 # xmm3 = xmm12[2],xmm13[2],xmm12[3],xmm13[3]
incl %eax
cmpl $0xa, %eax
jne 0x2489
vmovdqa %xmm2, 0x20(%rsp)
vmovdqa %xmm7, (%rsp)
vmovdqa (%rsp), %xmm2
vmovdqa 0x20(%rsp), %xmm7
vpxor 0x2c(%r13,%r15), %xmm2, %xmm2
vpxor %xmm9, %xmm9, %xmm9
vpblendw $0x1, %xmm9, %xmm2, %xmm8 # xmm8 = xmm9[0],xmm2[1,2,3,4,5,6,7]
vpxor -0x2(%r13,%r15), %xmm7, %xmm2
vpblendw $0x1, %xmm9, %xmm2, %xmm7 # xmm7 = xmm9[0],xmm2[1,2,3,4,5,6,7]
vpxor 0xe(%r13,%r15), %xmm4, %xmm4
vpxor 0x1e(%r13,%r15), %xmm5, %xmm2
vpxor 0x3c(%r13,%r15), %xmm3, %xmm5
vpxor 0x4c(%r13,%r15), %xmm6, %xmm3
vmovd 0xc50(%rip), %xmm9      # 0x31c8
vpxor %xmm7, %xmm9, %xmm6
vmovdqa %xmm6, 0x20(%rsp)
vpxor %xmm9, %xmm8, %xmm7
vmovdqa %xmm7, (%rsp)
leaq 0x22(%rsp), %rcx
movq (%rcx), %rax
movq 0x6(%rcx), %rcx
movq %rcx, 0x6(%r14,%r15)
movq %rax, (%r14,%r15)
vmovdqu %xmm4, 0xe(%r14,%r15)
vmovdqu %xmm2, 0x1e(%r14,%r15)
leaq 0x2(%rsp), %rcx
movq (%rcx), %rax
movq 0x6(%rcx), %rcx
movq %rax, 0x2e(%r14,%r15)
movq %rcx, 0x34(%r14,%r15)
vmovdqu %xmm5, 0x3c(%r14,%r15)
vmovdqu %xmm3, 0x4c(%r14,%r15)
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm8
vmovdqa64 %xmm23, %xmm9
vmovdqa64 %xmm21, %xmm10
vmovdqa64 %xmm22, %xmm11
movl $0x1, %ecx
vaesenc %xmm8, %xmm6, %xmm6
vaesenc %xmm9, %xmm4, %xmm4
vaesenc %xmm10, %xmm2, %xmm2
vaesenc %xmm11, %xmm1, %xmm1
vaesenc %xmm8, %xmm7, %xmm7
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 0x25f2
vpunpckhdq %xmm6, %xmm4, %xmm12 # xmm12 = xmm4[2],xmm6[2],xmm4[3],xmm6[3]
vpunpckldq %xmm6, %xmm4, %xmm4 # xmm4 = xmm4[0],xmm6[0],xmm4[1],xmm6[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, %xmm6 # xmm6 = 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 %xmm7, %xmm5, %xmm12 # xmm12 = xmm5[2],xmm7[2],xmm5[3],xmm7[3]
vpunpckldq %xmm7, %xmm5, %xmm5 # xmm5 = xmm5[0],xmm7[0],xmm5[1],xmm7[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, %xmm7 # xmm7 = 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 0x25ed
vpxor %xmm7, %xmm6, %xmm7
vpxor %xmm5, %xmm4, %xmm5
vpxor %xmm3, %xmm2, %xmm9
addq $0x5c, %r15
addq $-0x5c, %rbp
movq %r15, (%rsi)
vmovdqa64 %xmm16, %xmm10
vmovdqa64 %xmm17, %xmm11
jmp 0x298a
vmovdqa %xmm9, 0x70(%rsp)
vmovdqa %xmm6, 0x80(%rsp)
movq %rbp, %rax
movabsq $0x101010101010000, %rcx # imm = 0x101010101010000
imulq %rcx, %rax
orq $0x8063, %rax           # imm = 0x8063
movq %rax, 0xb0(%rsp)
movq %rbp, %rax
imulq 0xa8(%rsp), %rax
vpbroadcastq %rax, %ymm0
xorl %eax, %eax
vpmovsxbq 0xae0(%rip), %ymm2 # 0x31d8
vpbroadcastq 0xa2f(%rip), %ymm3 # 0x3130
vpbroadcastq %rax, %ymm1
vpor %ymm2, %ymm1, %ymm1
vpcmpltuq %ymm3, %ymm1, %k1
vmovdqu64 %ymm0, 0x6(%rbx,%rax,8) {%k1}
addq $0x4, %rax
cmpq $0x8, %rax
jne 0x2701
leaq (%r15,%r13), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
vzeroupper
callq 0x1090
movq 0x18(%rsp), %rsi
vmovdqa 0x90(%rsp), %xmm14
vmovdqa 0x60(%rsp), %xmm15
vmovdqa 0x50(%rsp), %xmm10
movq 0x10(%rsp), %r8
vmovdqa 0x40(%rsp), %xmm11
vmovdqa64 0xe0(%rsp), %xmm18
vmovdqa64 0x30(%rsp), %xmm19
vmovd 0xa4c(%rip), %xmm20     # 0x31c4
vpbroadcastq 0x996(%rip), %xmm21 # 0x3118
vpbroadcastq 0x984(%rip), %xmm22 # 0x3110
vpbroadcastq 0x98a(%rip), %xmm23 # 0x3120
vpbroadcastq 0x988(%rip), %xmm24 # 0x3128
vmovdqa 0xf0(%rsp), %xmm8
vmovdqa 0x80(%rsp), %xmm6
vmovdqa 0x70(%rsp), %xmm9
vpxor %xmm0, %xmm0, %xmm0
vpblendw $0xfe, (%rsp), %xmm0, %xmm0 # xmm0 = xmm0[0],mem[1,2,3,4,5,6,7]
vpxor 0xb0(%rsp), %xmm0, %xmm7
vmovdqa %xmm7, (%rsp)
vpxor 0xc0(%rsp), %xmm6, %xmm5
vpxor 0xd0(%rsp), %xmm9, %xmm9
vmovdqa %xmm7, 0x100(%rsp)
leaq (%r14,%r15), %rdi
vmovdqa %xmm5, 0x110(%rsp)
vmovdqa %xmm9, 0x120(%rsp)
cmpq $0x2e, %rbp
jb 0x282c
leaq 0x102(%rsp), %rax
vmovdqu (%rax), %ymm0
vmovdqu 0xe(%rax), %ymm1
vmovdqu %ymm1, 0xe(%rdi)
vmovdqu %ymm0, (%rdi)
movl $0x2e, %eax
jmp 0x28e2
leaq 0x102(%rsp), %rsi
movq %rbp, %rdx
vmovdqa %xmm7, 0x80(%rsp)
vmovdqa %xmm9, 0x70(%rsp)
vmovdqa %xmm5, 0x130(%rsp)
vzeroupper
callq 0x1090
vmovdqa 0x130(%rsp), %xmm5
vmovdqa 0x70(%rsp), %xmm9
vmovdqa 0x80(%rsp), %xmm7
vmovdqa 0xf0(%rsp), %xmm8
vpbroadcastq 0x8a6(%rip), %xmm24 # 0x3128
vpbroadcastq 0x894(%rip), %xmm23 # 0x3120
vpbroadcastq 0x87a(%rip), %xmm22 # 0x3110
vpbroadcastq 0x878(%rip), %xmm21 # 0x3118
vmovd 0x91a(%rip), %xmm20     # 0x31c4
vmovdqa64 0x30(%rsp), %xmm19
vmovdqa64 0xe0(%rsp), %xmm18
vmovdqa 0x40(%rsp), %xmm11
movq 0x10(%rsp), %r8
vmovdqa 0x50(%rsp), %xmm10
vmovdqa 0x60(%rsp), %xmm15
vmovdqa 0x90(%rsp), %xmm14
movq 0x18(%rsp), %rsi
movq %rbp, %rax
vpxor %xmm0, %xmm0, %xmm0
vmovdqu %ymm0, 0x110(%rsp)
vmovdqu %ymm0, 0x100(%rsp)
addq %r15, %rax
movq %rax, (%rsi)
xorl %ecx, %ecx
vmovdqa64 %xmm24, %xmm0
vmovdqa64 %xmm23, %xmm1
vmovdqa64 %xmm22, %xmm2
vmovdqa64 %xmm21, %xmm3
movl $0x1, %edx
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 %edx
je 0x291d
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 %ecx
cmpl $0xa, %ecx
jne 0x2918
cmpq $0x2e, %rbp
leaq -0x2e(%rbp), %rbp
movl $0x0, %ecx
cmovbq %rcx, %rbp
movq %rax, %r15
vpxor %xmm9, %xmm15, %xmm15
vpxor %xmm5, %xmm10, %xmm10
vpxor %xmm7, %xmm11, %xmm11
testq %rbp, %rbp
jne 0x231c
vpxor %xmm0, %xmm0, %xmm0
vmovdqa %xmm0, (%rsp)
vmovdqa %xmm0, 0x20(%rsp)
testq %r12, %r12
je 0x2d2f
testq %r8, %r8
je 0x2e11
movabsq $0x101010101010000, %rax # imm = 0x101010101010000
leaq 0xb2(%rsp), %rbx
vmovd 0x7f3(%rip), %xmm18     # 0x31d0
vmovd 0x7dd(%rip), %xmm19     # 0x31c4
vpbroadcastq 0x727(%rip), %xmm20 # 0x3118
vpbroadcastq 0x715(%rip), %xmm21 # 0x3110
xorl %edx, %edx
vpbroadcastq 0x719(%rip), %xmm22 # 0x3120
vpbroadcastq 0x717(%rip), %xmm23 # 0x3128
movl $0x1e, %ebp
leaq 0x101(%rax), %r15
vmovd 0x7ad(%rip), %xmm24     # 0x31d4
xorl %r13d, %r13d
cmpq $0x3d, %r12
setb %al
testq %r13, %r13
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2a7b
cmpq $0x1e, %r12
jae 0x2a4e
vpaddq 0x732(%rip), %xmm18, %xmm18 # 0x3180
movq $0x0, 0xb0(%rsp)
jb 0x2b9c
vmovdqu (%r8,%r13), %xmm0
vmovdqu 0xe(%r8,%r13), %xmm1
vmovdqu %xmm1, 0xe(%rbx)
vmovdqu %xmm0, (%rbx)
jmp 0x2c69
vmovdqa64 %xmm11, %xmm17
vmovdqa64 %xmm10, %xmm16
vpaddq %xmm19, %xmm18, %xmm0
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), %xmm1
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, %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 0x2ae3
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 0x2ade
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 0x2d17
movq %r12, %rax
movabsq $0x101010101010000, %rcx # imm = 0x101010101010000
imulq %rcx, %rax
movq %rax, 0xb0(%rsp)
movq %r12, %rax
imulq %r15, %rax
vpbroadcastq %rax, %ymm0
movb $0x7, %al
kmovd %eax, %k1
vmovdqu64 %ymm0, 0x6(%rbx) {%k1}
leaq (%r8,%r13), %rsi
movq %rbx, %rdi
movq %r12, %rdx
vmovdqa %xmm15, 0x60(%rsp)
vmovdqa %xmm10, 0x50(%rsp)
vmovdqa %xmm11, 0x40(%rsp)
vmovdqa64 %xmm18, 0x30(%rsp)
vzeroupper
callq 0x1090
vmovd 0x5cc(%rip), %xmm24     # 0x31d4
vpbroadcastq 0x516(%rip), %xmm23 # 0x3128
vpbroadcastq 0x504(%rip), %xmm22 # 0x3120
xorl %edx, %edx
vpbroadcastq 0x4e8(%rip), %xmm21 # 0x3110
vpbroadcastq 0x4e6(%rip), %xmm20 # 0x3118
vmovd 0x588(%rip), %xmm19     # 0x31c4
vmovdqa64 0x30(%rsp), %xmm18
vmovdqa 0x40(%rsp), %xmm11
movq 0x10(%rsp), %r8
vmovdqa 0x50(%rsp), %xmm10
vmovdqa 0x60(%rsp), %xmm15
vmovdqa 0x90(%rsp), %xmm14
movq 0x18(%rsp), %rsi
vpaddq %xmm19, %xmm18, %xmm18
vmovdqa 0xb0(%rsp), %xmm3
vmovdqa 0xc0(%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 0x2caa
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 0x2ca5
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, %r13
testq %r12, %r12
jne 0x2a2a
vpxor %xmm0, %xmm0, %xmm0
vpblendw $0x1, %xmm0, %xmm11, %xmm0 # xmm0 = xmm0[0],xmm11[1,2,3,4,5,6,7]
vpaddq 0x46f(%rip), %xmm0, %xmm0 # 0x31b0
vpbroadcastq 0x3ce(%rip), %xmm1 # 0x3118
vpbroadcastq 0x3bd(%rip), %xmm2 # 0x3110
vpbroadcastq 0x3c4(%rip), %xmm3 # 0x3120
vpbroadcastq 0x3c3(%rip), %xmm4 # 0x3128
xorl %eax, %eax
vmovdqa %xmm2, %xmm5
movl $0x1, %ecx
vaesenc %xmm4, %xmm0, %xmm0
vaesenc %xmm3, %xmm10, %xmm10
vaesenc %xmm1, %xmm15, %xmm15
vaesenc %xmm5, %xmm14, %xmm14
vpaddq %xmm2, %xmm4, %xmm4
vpaddq %xmm2, %xmm3, %xmm3
vpaddq %xmm2, %xmm1, %xmm1
vpaddq %xmm2, %xmm5, %xmm5
decl %ecx
je 0x2d70
vpunpckhdq %xmm0, %xmm10, %xmm6 # xmm6 = xmm10[2],xmm0[2],xmm10[3],xmm0[3]
vpunpckldq %xmm0, %xmm10, %xmm0 # xmm0 = xmm10[0],xmm0[0],xmm10[1],xmm0[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 %xmm0, %xmm8, %xmm14 # xmm14 = xmm8[2],xmm0[2],xmm8[3],xmm0[3]
vpunpckldq %xmm0, %xmm8, %xmm0 # xmm0 = xmm8[0],xmm0[0],xmm8[1],xmm0[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 0x2d6b
movq (%rsi), %rax
vmovdqu %xmm0, (%r14,%rax)
addq $0x10, (%rsi)
vpxor %xmm0, %xmm0, %xmm0
vmovdqa %xmm0, (%rsp)
vmovdqa %xmm0, 0x20(%rsp)
jmp 0x2dec
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movq $0x0, (%rsi)
xorl %eax, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq
movl $0xfffffff9, %eax       # imm = 0xFFFFFFF9
jmp 0x2dee
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jmp 0x2dee
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
jmp 0x2dee